diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-18 10:11:32 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-18 10:11:32 -0700 |
commit | 132f3e2d37057eb4de13e32bf52c13097183c622 (patch) | |
tree | ea86e18bc3c2be95e54b2512b9d838fd77b2d722 | |
parent | a0a5a2a275dcf2d80ae405ae54fcc665b00824f1 (diff) | |
download | rails-132f3e2d37057eb4de13e32bf52c13097183c622.tar.gz rails-132f3e2d37057eb4de13e32bf52c13097183c622.tar.bz2 rails-132f3e2d37057eb4de13e32bf52c13097183c622.zip |
use -= in place of the expanded form
-rw-r--r-- | actionpack/lib/action_view/helpers/number_helper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/number_helper.rb b/actionpack/lib/action_view/helpers/number_helper.rb index b5de5c3422..326d5c1049 100644 --- a/actionpack/lib/action_view/helpers/number_helper.rb +++ b/actionpack/lib/action_view/helpers/number_helper.rb @@ -261,7 +261,7 @@ module ActionView digits = (Math.log10(number.abs) + 1).floor rounded_number = BigDecimal.new((number / 10 ** (digits - precision)).to_s).round.to_f * 10 ** (digits - precision) end - precision = precision - digits + precision -= digits precision = precision > 0 ? precision : 0 #don't let it be negative else rounded_number = BigDecimal.new((number * (10 ** precision)).to_s).round.to_f / 10 ** precision |