1
0
Fork 0
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:
Zach Gollwitzer 2024-10-03 10:25:38 -04:00 committed by GitHub
parent ab40289eb4
commit 82c298307d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 42 additions and 59 deletions

View file

@ -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