aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2017-09-19 18:27:33 +0900
committeryuuji.yaginuma <yuuji.yaginuma@gmail.com>2017-09-19 18:27:33 +0900
commit5533696015e256dfb61c62bc1d34eeb1b2b1cdf6 (patch)
tree7a9890a4f4386d075b9d77c53db279d6aaccaec4
parent42d09f6b49da619952267b22bd8800d9b816886b (diff)
downloadrails-5533696015e256dfb61c62bc1d34eeb1b2b1cdf6.tar.gz
rails-5533696015e256dfb61c62bc1d34eeb1b2b1cdf6.tar.bz2
rails-5533696015e256dfb61c62bc1d34eeb1b2b1cdf6.zip
Remove unused `NumberToRoundedConverter#digits_and_rounded_number`
`digits_and_rounded_number` is unused since #26628
-rw-r--r--activesupport/lib/active_support/number_helper/number_to_rounded_converter.rb12
1 files changed, 0 insertions, 12 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 3b62fe6819..b7ad76bb62 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,18 +37,6 @@ module ActiveSupport
private
- def digits_and_rounded_number(precision)
- if zero?
- [1, 0]
- else
- digits = digit_count(number)
- multiplier = 10**(digits - precision)
- rounded_number = calculate_rounded_number(multiplier)
- digits = digit_count(rounded_number) # After rounding, the number of digits may have changed
- [digits, rounded_number]
- end
- end
-
def calculate_rounded_number(multiplier)
(number / BigDecimal.new(multiplier.to_f.to_s)).round * multiplier
end