Search code examples
jqueryjquery-uijquery-ui-slider

jQuery UI Slider Range incorrect max value for fraction step


I am trying to make a jQuery UI slider range with the following options

min: 0,
max: 100,
step: 0.01

The range works for all the values except for the last one, which becomes 99.99000000000001. I have created a jsfiddle to recreate the issue. The behavior is different for the max value 50 and 100. Any help would be really appreciated.

PS: I am using jQuery UI v1.11.2 as in WP version 4.1.1. If I use jQuery UI version 1.11.3, then the same resolves. (Example).


Solution

  • Just set max: 50.001, max: 100.001 :)