diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2010-09-05 10:06:09 -0300 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2010-09-05 10:06:09 -0300 |
commit | 88dfe16d9536b8de4cc69bbe649131840bca9a2c (patch) | |
tree | c0365d920bb957029d95a69159aab9cd2a79e3a6 /actionpack/lib/action_view/helpers | |
parent | b80cf265be083b158c915ccbb4af7ce5ac05aec7 (diff) | |
download | rails-88dfe16d9536b8de4cc69bbe649131840bca9a2c.tar.gz rails-88dfe16d9536b8de4cc69bbe649131840bca9a2c.tar.bz2 rails-88dfe16d9536b8de4cc69bbe649131840bca9a2c.zip |
Fix code style a bit
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r-- | actionpack/lib/action_view/helpers/number_helper.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/number_helper.rb b/actionpack/lib/action_view/helpers/number_helper.rb index 7b3751de46..98df5c169b 100644 --- a/actionpack/lib/action_view/helpers/number_helper.rb +++ b/actionpack/lib/action_view/helpers/number_helper.rb @@ -459,8 +459,7 @@ module ActionView raise ArgumentError, ":units must be a Hash or String translation scope." end.keys.map{|e_name| DECIMAL_UNITS.invert[e_name] }.sort_by{|e| -e} - number_exponent = 0 - number_exponent = Math.log10(number).floor if number != 0 + number_exponent = number != 0 ? Math.log10(number).floor : 0 display_exponent = unit_exponents.find{|e| number_exponent >= e } number /= 10 ** display_exponent |