From fcb6e36480cd38314a7ef01fd4941ed175884993 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Mon, 16 Oct 2023 11:19:11 +1100 Subject: [PATCH] Format money amounts according to locale It used to be formatted according to the currency. So even if the default currency is USD but your locale is French then you should see it formatted as $10.000,00 instead of the US formatting of $10,000.00. --- config/initializers/money.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/initializers/money.rb b/config/initializers/money.rb index 9626e2cad1..406b059e56 100644 --- a/config/initializers/money.rb +++ b/config/initializers/money.rb @@ -1,4 +1,5 @@ Rails.application.reloader.to_prepare do + Money.locale_backend = :i18n Money.rounding_mode = BigDecimal::ROUND_HALF_EVEN Money.default_currency = Money::Currency.new(ENV.fetch('CURRENCY')) end