aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/number_helper
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/number_helper')
-rw-r--r--activesupport/lib/active_support/number_helper/number_to_rounded_converter.rb8
-rw-r--r--activesupport/lib/active_support/number_helper/rounding_helper.rb2
2 files changed, 1 insertions, 9 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 b7ad76bb62..eb528a0583 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
@@ -37,14 +37,6 @@ module ActiveSupport
private
- def calculate_rounded_number(multiplier)
- (number / BigDecimal.new(multiplier.to_f.to_s)).round * multiplier
- end
-
- def digit_count(number)
- number.zero? ? 1 : (Math.log10(absolute_number(number)) + 1).floor
- end
-
def strip_insignificant_zeros
options[:strip_insignificant_zeros]
end
diff --git a/activesupport/lib/active_support/number_helper/rounding_helper.rb b/activesupport/lib/active_support/number_helper/rounding_helper.rb
index a5b28296a2..2ad8d49c4e 100644
--- a/activesupport/lib/active_support/number_helper/rounding_helper.rb
+++ b/activesupport/lib/active_support/number_helper/rounding_helper.rb
@@ -36,7 +36,7 @@ module ActiveSupport
return 0 if number.zero?
digits = digit_count(number)
multiplier = 10**(digits - precision)
- (number / BigDecimal.new(multiplier.to_f.to_s)).round * multiplier
+ (number / BigDecimal(multiplier.to_f.to_s)).round * multiplier
end
def convert_to_decimal(number)