This project is archived and is in readonly mode.
number_to_currency(101.00) returns $110
Reported by Mike (at coverallcrew) | May 3rd, 2010 @ 10:32 PM
The title says it all.
Using Rails 3 Beta 3
Comments and changes to this ticket
-
Adam Roth May 4th, 2010 @ 04:22 AM
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) May 4th, 2010 @ 06:06 AM
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 May 4th, 2010 @ 06:35 AM
Mike, can you give pastie of your console showing it is failing along with Ruby version you are using.
-
Santiago Pastorino May 4th, 2010 @ 07:08 AM
- Assigned user set to Santiago Pastorino
With the latest code from edge using 1.8.7 runs nice
-
Neeraj Singh May 4th, 2010 @ 04:36 PM
I tested it with rails3 edge. And this is the result I got in console.
=> "$101.00"
-
Mike (at coverallcrew) May 4th, 2010 @ 05:26 PM
Here is my Gemfile. Perhaps it is something here that is conflicting.
-
Josh Kalderimis May 10th, 2010 @ 11:28 AM
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 May 10th, 2010 @ 02:29 PM
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 May 10th, 2010 @ 04:51 PM
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 May 10th, 2010 @ 05:39 PM
- State changed from new to invalid
So ok update you Ruby version guys patchlevel 249 doesn't have this problem
-
Mike (at coverallcrew) May 10th, 2010 @ 05:40 PM
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 May 11th, 2010 @ 02:50 PM
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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>