diff --git a/lib/data_mapper/validation/rule/numericalness.rb b/lib/data_mapper/validation/rule/numericalness.rb index 414e5c68..fb664f84 100644 --- a/lib/data_mapper/validation/rule/numericalness.rb +++ b/lib/data_mapper/validation/rule/numericalness.rb @@ -68,7 +68,7 @@ def valid?(resource) def value_as_string(value) case value # Avoid Scientific Notation in Float to_s - when Float then value.to_d.to_s('F') + when Float then value.to_d(options.fetch(:precision, nil)).to_s('F') when BigDecimal then value.to_s('F') else value.to_s end