Permalink
Browse files

Fix code style a bit

  • Loading branch information...
1 parent 935fa9d commit 9fe7ef65ea385fab74b45c793807008530624cbf @spastorino spastorino committed Sep 5, 2010
Showing with 1 addition and 2 deletions.
  1. +1 −2 actionpack/lib/action_view/helpers/number_helper.rb
@@ -459,8 +459,7 @@ def number_to_human(number, options = {})
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

0 comments on commit 9fe7ef6

Please sign in to comment.