mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 15:49:39 +02:00
Add formatting for EUR locales (#1231)
* Add formatting for EUR locales * Fix formatting assertion for EUR in english locales
This commit is contained in:
parent
ab40289eb4
commit
82c298307d
6 changed files with 42 additions and 59 deletions
|
@ -138,13 +138,13 @@ module ApplicationHelper
|
|||
|
||||
def format_money(number_or_money, options = {})
|
||||
money = Money.new(number_or_money)
|
||||
options.reverse_merge!(money.default_format_options)
|
||||
options.reverse_merge!(money.format_options(I18n.locale))
|
||||
number_to_currency(money.amount, options)
|
||||
end
|
||||
|
||||
def format_money_without_symbol(number_or_money, options = {})
|
||||
money = Money.new(number_or_money)
|
||||
options.reverse_merge!(money.default_format_options)
|
||||
options.reverse_merge!(money.format_options(I18n.locale))
|
||||
ActiveSupport::NumberHelper.number_to_delimited(money.amount.round(options[:precision] || 0), { delimiter: options[:delimiter], separator: options[:separator] })
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue