diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2010-01-06 23:34:40 -0800 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-01-06 23:35:03 -0800 |
commit | 816ba1e15a709337a99a931e80dddfe5bf972de5 (patch) | |
tree | fcaa3e04d2b630a08b4c33203c89d5b468f608c7 /activesupport/lib | |
parent | 74f6ccea201d778e020f8c758013d90ea8a5c8a1 (diff) | |
download | rails-816ba1e15a709337a99a931e80dddfe5bf972de5.tar.gz rails-816ba1e15a709337a99a931e80dddfe5bf972de5.tar.bz2 rails-816ba1e15a709337a99a931e80dddfe5bf972de5.zip |
Remove unneeded reliance on Numeric#round quirk
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/float/rounding.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/float/rounding.rb b/activesupport/lib/active_support/core_ext/float/rounding.rb index 0b1ae4be7e..9bdf5bba7b 100644 --- a/activesupport/lib/active_support/core_ext/float/rounding.rb +++ b/activesupport/lib/active_support/core_ext/float/rounding.rb @@ -1,5 +1,6 @@ class Float - remove_method :round + alias precisionless_round round + private :precisionless_round # Rounds the float with the specified precision. # @@ -12,7 +13,7 @@ class Float magnitude = 10.0 ** precision (self * magnitude).round / magnitude else - super() + precisionless_round end end end |