soanvig / mm-jsr

Range input solution without dependencies
https://soanvig.github.io/mm-jsr
GNU Lesser General Public License v3.0
56 stars 16 forks source link

Limits should be rounded to step ratio #34

Closed soanvig closed 3 years ago

soanvig commented 6 years ago

If limit is not rounded to step ratio, they are vulnerable to be exceeded by value rounded to stepRatio.

E.g.:

stepRatio = 0.1;
value = 0.998;
limit = 0.999;

roundedValue = 1;

roundedValue > limit

It should not be a problem, but better consistency === better code.

soanvig commented 3 years ago

Closing, because this won't be issue in v2 - limits are applied after rounding value