aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/number_helper/number_to_rounded_converter.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/number_helper/number_to_rounded_converter.rb')
-rw-r--r--activesupport/lib/active_support/number_helper/number_to_rounded_converter.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/number_helper/number_to_rounded_converter.rb b/activesupport/lib/active_support/number_helper/number_to_rounded_converter.rb
index 9fb7dfb779..cfcb0045fb 100644
--- a/activesupport/lib/active_support/number_helper/number_to_rounded_converter.rb
+++ b/activesupport/lib/active_support/number_helper/number_to_rounded_converter.rb
@@ -29,10 +29,10 @@ module ActiveSupport
formatted_string =
if BigDecimal === rounded_number && rounded_number.finite?
- s = rounded_number.to_s('F')
- s << '0'.freeze * precision
- a, b = s.split('.'.freeze, 2)
- a << '.'.freeze
+ s = rounded_number.to_s("F")
+ s << "0".freeze * precision
+ a, b = s.split(".".freeze, 2)
+ a << ".".freeze
a << b[0, precision]
else
"%00.#{precision}f" % rounded_number
@@ -74,7 +74,7 @@ module ActiveSupport
def format_number(number)
if strip_insignificant_zeros
escaped_separator = Regexp.escape(options[:separator])
- number.sub(/(#{escaped_separator})(\d*[1-9])?0+\z/, '\1\2').sub(/#{escaped_separator}\z/, '')
+ number.sub(/(#{escaped_separator})(\d*[1-9])?0+\z/, '\1\2').sub(/#{escaped_separator}\z/, "")
else
number
end