In validators/numeric_validator.rb on line 38
def value_as_string(value)
case value
# Avoid Scientific Notation in Float to_s
when Float then value.to_d.to_s('F')
when BigDecimal then value.to_s('F')
else value.to_s
end
end
Given: f=-75.6942185
We call, f.to_d.to_s('F')
On all rubies except 1.9.3 we get:
"-75.6942185"
On MRI 1.9.3 we get:
"-75.69421850000001"
When then causes the validator to report an invalid precision/scale
In validators/numeric_validator.rb on line 38
Given:
f=-75.6942185We call,
f.to_d.to_s('F')On all rubies except 1.9.3 we get:
"-75.6942185"
On MRI 1.9.3 we get:
"-75.69421850000001"
When then causes the validator to report an invalid precision/scale