This project is archived and is in readonly mode.
number_to_currency(101.00) returns $110
-
Adam Roth
From a view:
<%= number_to_currency(101.00) %>outputs: $101.00
...and from the console:
foo = ActionView::Base.new foo.extend ActionView::Helpers::NumberHelper foo.number_to_currency(101.00) => "$101.00"Tested Rails "3.0.0.beta3"
Are you passing in any additional parameters to number_to_currency?
-
Mike (at coverallcrew)
I'm not passing anything else. Tried from the console, and mine fails with $110.00. Are you running the gem version of Rails 3 Beta 3 perhaps?
-
Anil Wadghule
Mike, can you give pastie of your console showing it is failing along with Ruby version you are using.
-
Santiago Pastorino
- Assigned user set to Santiago Pastorino
With the latest code from edge using 1.8.7 runs nice
-
Neeraj Singh
I tested it with rails3 edge. And this is the result I got in console.
=> "$101.00"
-
Mike (at coverallcrew)
Here is my Gemfile. Perhaps it is something here that is conflicting.
-
Josh Kalderimis
You might want to go through and comment out gem by gem in your Gemfile to see if any are causing this issue.
-
Santiago Pastorino
Yes, first you should try with a fresh application and if all is working could be a bug related with one of the plugins you are using.
-
Kim Toms
As far as I can tell, it's in BigDecimal.
Kims-Mac:bug4278 kim$ irb irb(main):001:0> RUBY_VERSION => "1.8.7" irb(main):002:0> RUBY_PATCHLEVEL => 173 irb(main):003:0> require 'bigdecimal' => true irb(main):004:0> BigDecimal.new('10100') => #<BigDecimal:10039f778,'0.11E5',8(12)> irb(main):005:0> -
Santiago Pastorino
- State changed from new to invalid
So ok update you Ruby version guys patchlevel 249 doesn't have this problem
-
Mike (at coverallcrew)
Hi Kim,
Yeah, it looks like BigDecimal is doing something funky. I have the same version and patchlevel and same result as you.
-
Andrew White
The last update to Snow Leopard (10.6.3) shipped with a version of ruby 1.8.7 with a known bug in BigDecimal. Apple really dropped the ball on this one - the fixed version has been available since June 2009.
One more reason to use RVM.