Use user locale instead of default locale to format currencies

This commit is contained in:
Bertocq
2018-02-06 11:17:03 +01:00
parent a92ef57bf8
commit b72e43168b
2 changed files with 2 additions and 2 deletions

View File

@@ -58,7 +58,7 @@ module ApplicationHelper
end end
def format_price(number) def format_price(number)
number_to_currency(number, precision: 0, locale: I18n.default_locale) number_to_currency(number, precision: 0, locale: I18n.locale)
end end
def kaminari_path(url) def kaminari_path(url)

View File

@@ -124,7 +124,7 @@ class Budget < ActiveRecord::Base
def formatted_amount(amount) def formatted_amount(amount)
ActionController::Base.helpers.number_to_currency(amount, ActionController::Base.helpers.number_to_currency(amount,
precision: 0, precision: 0,
locale: I18n.default_locale, locale: I18n.locale,
unit: currency_symbol) unit: currency_symbol)
end end