Merge pull request #34767 from y-yagi/fix_convert_string_to_bigdecimal
Use BigDecimal provided methods to convert String to BigDecimal
This commit is contained in:
commit
5abe612b0d
@ -68,11 +68,7 @@ def content_type
|
||||
"float" => Proc.new { |float| float.to_f },
|
||||
"decimal" => Proc.new do |number|
|
||||
if String === number
|
||||
begin
|
||||
BigDecimal(number)
|
||||
rescue ArgumentError
|
||||
BigDecimal(number.to_f.to_s)
|
||||
end
|
||||
number.to_d
|
||||
else
|
||||
BigDecimal(number)
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user