Change number_to_human calls to always use 3-digits precision (#16469)
Fixes #16435
This commit is contained in:
parent
225c6582d1
commit
e2844b7e58
14 changed files with 44 additions and 33 deletions
|
@ -14,6 +14,17 @@ module ApplicationHelper
|
|||
ku
|
||||
).freeze
|
||||
|
||||
def friendly_number_to_human(number, **options)
|
||||
# By default, the number of precision digits used by number_to_human
|
||||
# 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
|
||||
|
||||
number_to_human(number, **options)
|
||||
end
|
||||
|
||||
def active_nav_class(*paths)
|
||||
paths.any? { |path| current_page?(path) } ? 'active' : ''
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue