method
convert_to_decimal
v7.2.3 -
Show latest stable
- Class:
ActiveSupport::NumberHelper::RoundingHelper
convert_to_decimal(number)private
No documentation available.
# File activesupport/lib/active_support/number_helper/rounding_helper.rb, line 26
def convert_to_decimal(number)
case number
when Float, String
BigDecimal(number.to_s)
when Rational
BigDecimal(number, digit_count(number.to_i) + options[:precision])
else
number.to_d
end
end