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

Rounding error with domain that contain decimals #122

Open
theronpatrick opened this issue Aug 7, 2020 · 1 comment
Open

Rounding error with domain that contain decimals #122

theronpatrick opened this issue Aug 7, 2020 · 1 comment

Comments

@theronpatrick
Copy link

Problem or feature description:

When setting up a slider using values that have decimals, rounding errors can occur.

Steps to reproduce (for problems):

See this fork of codesandbox example: https://codesandbox.io/s/react-compound-slider-svg-decimal-bug-ggr33?file=/index.js

If you set the domain from 1.4 - 1.6, with a step of 0.1, the initial max value will be 1.5999999999999999 instead of 1.6.

Versions (for problems):

React-Compound-Slider:
2.5.0

React:
16.12.0

Browser:
Chrome

Operating System:
MacOS 10.14.6

@ralphking
Copy link

Hi @theronpatrick , did you find an elegant way to mitigate this? Having the same issue!

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

No branches or pull requests

2 participants