class ActiveSupport::NumberHelper::NumberToHumanConverter
def convert # :nodoc:
def convert # :nodoc: @number = RoundingHelper.new(options).round(number) @number = Float(number) # For backwards compatibility with those that didn't add strip_insignificant_zeros to their locale files. unless options.key?(:strip_insignificant_zeros) options[:strip_insignificant_zeros] = true end units = opts[:units] exponent = calculate_exponent(units) @number = number / (10**exponent) rounded_number = NumberToRoundedConverter.convert(number, options) unit = determine_unit(units, exponent) format.gsub("%n", rounded_number).gsub("%u", unit).strip end