# File lib/merb-helpers/core_ext/numeric.rb, line 221
    def self.to_currency(number, format_name = nil, options = {})
      
      format = (formats[format_name] || default_format)[:currency].merge(options)

      begin
        format[:format].gsub(/%n/, with_precision(number, 
                                      format_name, :precision  => format[:precision]) ).gsub(/%u/, format[:unit])
      rescue
        number
      end
    end