method
determine_unit
v8.1.1 -
Show latest stable
- Class:
ActiveSupport::NumberHelper::NumberToHumanConverter
determine_unit(units, exponent)private
No documentation available.
# File activesupport/lib/active_support/number_helper/number_to_human_converter.rb, line 38
def determine_unit(units, exponent)
exp = DECIMAL_UNITS[exponent]
case units
when Hash
units[exp] || ""
when String, Symbol
I18n.translate("#{units}.#{exp}", locale: options[:locale], count: number.to_i)
else
translate_in_locale("human.decimal_units.units.#{exp}", count: number.to_i)
end
end