This project is archived and is in readonly mode.
[VERIFIED] number_to_precision rounding error
Reported by Arndt Touby | February 25th, 2009 @ 02:57 PM
number_with_precision( 32.675, :prescision => 2 ) outputs "32,67" and not "32,68" as expected.
number_with_precision( 31.675, :prescision => 2 ) outputs "31,68" as expected.
This occurred in Rails 2.2.2
Comments and changes to this ticket
-
CancelProfileIsBroken August 5th, 2009 @ 02:07 PM
- Tag set to 2.2.2, bug, bugmash, error
-
Rizwan Reza August 7th, 2009 @ 08:57 PM
- Tag changed from 2.2.2, bug, bugmash, error to 2.2.2, 2.3.x, bug, bugmash, error
verified
+1 This bug is present in 2.3.3 as well.
-
anupom syam August 7th, 2009 @ 09:40 PM
- seems like this is an issue with Ruby.
irb(main):080:0> 3267.5.round => 3268 irb(main):081:0> (32.675 * 100.00) => 3267.5 irb(main):082:0> (32.675 * 100.00).round => 3267 irb(main):083:0> 3267.5.round => 3268
-
Ryan Bigg August 8th, 2009 @ 12:55 AM
- Title changed from number_to_precision rounding error to [VERIFIED] number_to_precision rounding error
-
Repository August 8th, 2009 @ 02:08 AM
- State changed from new to resolved
(from [98450fd168673c6bc698b3b2d3c264a9cd70a464]) Fix number_to_precision rounding error [#2071 state:resolved]
Signed-off-by: Pratik Naik pratiknaik@gmail.com
http://github.com/rails/rails/commit/98450fd168673c6bc698b3b2d3c264... -
CancelProfileIsBroken August 8th, 2009 @ 11:07 PM
- Tag changed from 2.2.2, 2.3.x, bug, bugmash, error to 2.2.2, 2.3.x, bug, error
- Milestone cleared.
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>
People watching this ticket
Attachments
Referenced by
- 2071 [VERIFIED] number_to_precision rounding error (from [98450fd168673c6bc698b3b2d3c264a9cd70a464]) Fix num...
- 1340 Rounding problem in number_with_precision Ticket #2071 seems to be a duplicate of this report.