1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix code style a bit

This commit is contained in:
Santiago Pastorino 2010-09-05 10:06:09 -03:00
parent b80cf265be
commit 88dfe16d95

View file

@ -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