logo       

[Rails I18n] Globalize Currency Negative Value Error: msg#00013

lang.ruby.rails.i18n

Subject: [Rails I18n] Globalize Currency Negative Value Error

I've got the Globalize-1.1 release installed and have been using the
globalize plugin for a month or so now. My base locale is en-US, Ruby
1.8.4 (2005-12-24), Rails 1.1.2. Here's the problem taken from
./script/console:


Loading development environment.
>> Globalize::Currency.new("-340")
=> #<Globalize::Currency:0x2337478 @cents=-340>
>> Globalize::Currency.new("-340").to_s
=> "-4.60"
>> Globalize::Currency.new("340").to_s
=> "3.40"
>> Globalize::Currency.new("-340").to_s
=> "-4.60"

>> Locale.set("en-US")
=> ...
>> Globalize::Currency.new("-340").format
=> "-$4.60"
>> Globalize::Currency.new("340").format
=> "$3.40"


Any insights and/or patches would be greatly appreciated.

Nate


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise