def precision_for amount, currency
      defined_minor_precision                         = definitions[currency][:minor_unit]
      match                                           = amount.to_s.match(/^-?(\d*)\.?(\d*)e?(-?\d+)?$/).to_a[1..3]
      given_major_precision, given_minor_precision    = precision_from_match *match
      
      given_major_precision + [defined_minor_precision, given_minor_precision].max
    end
def precision_for amount, currency
      defined_minor_precision                         = definitions[currency][:minor_unit]
      match                                           = amount.to_s.match(/^-?(\d*)\.?(\d*)e?(-?\d+)?$/).to_a[1..3]
      given_major_precision, given_minor_precision    = precision_from_match *match
      
      given_major_precision + [defined_minor_precision, given_minor_precision].max
    end
get a precision for a specified amount and a specified currency

 @params [Float, Integer] amount The amount to get the precision for
 @params [Symbol] currency the currency to get the precision for