]> cat aescling's git repositories - mastodon.git/commitdiff
Fix unusual number formatting in some locales (#17929)
authorClaire <claire.github-309c@sitedethib.com>
Fri, 1 Apr 2022 21:59:13 +0000 (23:59 +0200)
committerGitHub <noreply@github.com>
Fri, 1 Apr 2022 21:59:13 +0000 (23:59 +0200)
* Fix unusual number formatting in some locales

Fixes #17904

* Fix typo

app/helpers/application_helper.rb

index 651a98a8548a40cca3c3d04308c0c07548f4c011..9984820da7a450ca128f04340e0cee9c9c9a9f4c 100644 (file)
@@ -19,8 +19,11 @@ module ApplicationHelper
     # 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
     # override these values with a default of 3 digits of precision.
-    options[:precision] = 3
-    options[:strip_insignificant_zeros] = true
+    options = options.merge(
+      precision: 3,
+      strip_insignificant_zeros: true,
+      significant: true
+    )
 
     number_to_human(number, **options)
   end