Module: JekyllMoney2::Core
Instance Method Summary collapse
- #money(value, currency = "USD", options = {}) ⇒ Object
- #money_from_amount(value, currency = 'USD', options = {}) ⇒ Object
Instance Method Details
#money(value, currency = "USD", options = {}) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/jekyll-money2/core.rb', line 15 def money(value, currency = "USD", = {}) @defaults = defaults unless defined?(@defaults) @options = @defaults.merge() value = validate_money!(value, currency) format_money(value, currency, ) end |
#money_from_amount(value, currency = 'USD', options = {}) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/jekyll-money2/core.rb', line 23 def money_from_amount(value, currency = 'USD', = {}) @defaults = defaults unless defined?(@defaults) @options = @defaults.merge() value = Money.from_amount(value.to_f, currency) format_money(value, currency, ) end |