Skip to content

Step of 0.01 results in too many decimal places in some generated values #131

Description

@DanEastBentley

Problem or feature description:

When using step={0.01}, the value generated occasionally has too many decimal places: e.g. 0.47000000000000003 instead of 0.47.

Steps to reproduce (for problems):

Go to https://codesandbox.io/s/pjwwzzj8qm (from https://www.npmjs.com/package/react-compound-slider) and change step={1} to step={0.01}. Move the slider and notice the occasional value with too many decimal places.

Versions (for problems):

React-Compound-Slider:
3.3.1

React:
16.14.0

Browser:
Chrome for Windows 86.0.4240.198

Operating System:
Windows 10 Enterprise, Version 1909

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions