Displaying 1 result from an estimated 1 matches for "dollar_part".
2006 Jan 19
5
123 * 3 => 123123123! But why?
...=> 0.75,
                :EUR => 1.1,
                :GBP => 3.1
              }
      value = rates[code.to_sym]
      raise "No conversion rate found for currency ''#{code}'' 
(#{Locale.active.language.english_name})!" if value.nil?
      value
    end
    def dollar_part
      na? ? nil : cents / 100 / conversion_rate
    end
    def cent_part
      na? ? nil : cents % 100 / conversion_rate
    end
  end
end
--------
Sadly I get ugly results like
$99.00 # correct!
SFr. 132,0.00 # incorrect!
? 90,0,00 # incorrect!
I don''t know why Ruby concatenates the...