class ActiveSupport::NumberHelper::NumberToCurrencyConverter

def convert

def convert
  format = options[:format]
  number_d = valid_bigdecimal
  if number_d
    if number_d.negative?
      number_d = number_d.abs
      format = options[:negative_format] if (number_d * 10**options[:precision]) >= 0.5
    end
    number_s = NumberToRoundedConverter.convert(number_d, options)
  else
    number_s = number.to_s.strip
    format = options[:negative_format] if number_s.sub!(/^-/, "")
  end
  format.gsub("%n", number_s).gsub("%u", options[:unit])
end