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

Grid values aren't rounded #760

Open
hetzner opened this issue Aug 2, 2021 · 2 comments
Open

Grid values aren't rounded #760

hetzner opened this issue Aug 2, 2021 · 2 comments
Assignees
Labels
Help wanted Person asking for help

Comments

@hetzner
Copy link

hetzner commented Aug 2, 2021

The grid values should be rounded to avoid display like this:
grafik

$(".js-range-slider").ionRangeSlider({
    type: "double",
    skin: "round",
    grid: true,
    grid_num: 4,
    min: -39.90,
    max: 111.00,
    from: -39.90,
    to: 111.00
});
@hetzner
Copy link
Author

hetzner commented Aug 2, 2021

Same issue occurs when moving the slider:
grafik

Additional note: In this example the issue occurs for all values between -16 and 16. For all values outside this range the values (grid marks and current values) are rounded correctly.

JSFiddle Test Case: https://jsfiddle.net/tjubx43m/

@IonDen
Copy link
Owner

IonDen commented Aug 2, 2021

Hi, this is how division works on computers :)
But you could fix precision using step attribute.

Example: https://jsfiddle.net/IonDen/thcen42d/

@IonDen IonDen self-assigned this Aug 20, 2021
@IonDen IonDen added the Help wanted Person asking for help label Aug 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help wanted Person asking for help
Projects
None yet
Development

No branches or pull requests

2 participants