This is really much more of a JavaScript limitation than any problem with your library.
But just wondering - when using "divisibleBy" validation with fractional values (the common use-case is dollar values, ie. divisibleBy 0.01), JavaScript has a nasty habit of introducing rounding errors.
So you end up getting things like 291.14 / 0.01 = 29113.999999999996, which really breaks things badly. How would you feel about working around this stuff by multiplying by the inverse of the divisor first ((291.14 * (0.01/1)) / (0.01 * (0.01/1)) = 29114)? Good idea, or outside the scope of your work?
This is really much more of a JavaScript limitation than any problem with your library.
But just wondering - when using "divisibleBy" validation with fractional values (the common use-case is dollar values, ie. divisibleBy 0.01), JavaScript has a nasty habit of introducing rounding errors.
So you end up getting things like
291.14 / 0.01 = 29113.999999999996
, which really breaks things badly. How would you feel about working around this stuff by multiplying by the inverse of the divisor first ((291.14 * (0.01/1)) / (0.01 * (0.01/1)) = 29114
)? Good idea, or outside the scope of your work?cheers