Class: HledgerForecast::Formatter

Inherits:
Object
  • Object
show all
Defined in:
lib/hledger_forecast/formatter.rb

Class Method Summary collapse

Class Method Details

.format_money(amount, settings) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/hledger_forecast/formatter.rb', line 3

def self.format_money(amount, settings)
  Money.from_cents(amount.to_f * 100, settings.currency).format(
    symbol: settings.show_symbol,
    sign_before_symbol: settings.sign_before_symbol,
    thousands_separator: resolve_separator(settings.thousands_separator)
  )
end