Fix unusual number formatting in some locales (#17929)

* Fix unusual number formatting in some locales

Fixes #17904

* Fix typo
lolsob-rspec
Claire 2022-04-01 23:59:13 +02:00 committed by GitHub
parent fb3fc6cab4
commit 4001f3810c
1 changed files with 5 additions and 2 deletions

View File

@ -19,8 +19,11 @@ module ApplicationHelper
# is looked up from the locales definition, and rails-i18n comes with # is looked up from the locales definition, and rails-i18n comes with
# values that don't seem to make much sense for many languages, so # values that don't seem to make much sense for many languages, so
# override these values with a default of 3 digits of precision. # override these values with a default of 3 digits of precision.
options[:precision] = 3 options = options.merge(
options[:strip_insignificant_zeros] = true precision: 3,
strip_insignificant_zeros: true,
significant: true
)
number_to_human(number, **options) number_to_human(number, **options)
end end