Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning emitted by isStepDivisible due to floating point value mismatch #110

Open
forestlovewood opened this issue Nov 22, 2020 · 3 comments
Labels
good first issue Good for newcomers

Comments

@forestlovewood
Copy link

I just noticed that if you try and create a Range control which has the following props <Range step={0.1} min={0.1} max={50} ... /> it will emit a The difference of max and min must be divisible by step warning.

This appears to be because (50 - 0.1) / 0.1 equals 498.99999999999994 in JavaScript, but the expression parseInt(res.toString(), 10) actually just returns 498. Most calculators would return 499 for both.

Thank you!

@tajo
Copy link
Owner

tajo commented Nov 25, 2020

Ah, maybe we should just remove that warning,

@tajo tajo added the good first issue Good for newcomers label Nov 25, 2020
@AbeCole
Copy link

AbeCole commented Jul 15, 2021

+1 remove it

@dgershun
Copy link
Contributor

@tajo I fixed this problem in PR above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants