]> source.dussan.org Git - jquery-ui.git/commitdiff
slider: limit the returned floats to 5 digits after the decimal point, corrects JS...
authorPaul Bakaus <paul.bakaus@googlemail.com>
Tue, 17 Feb 2009 13:01:19 +0000 (13:01 +0000)
committerPaul Bakaus <paul.bakaus@googlemail.com>
Tue, 17 Feb 2009 13:01:19 +0000 (13:01 +0000)
ui/ui.slider.js

index 91f257157ffad690908eeeefcc48b7e0cc65bd83..2b388c6d5f3c4e47b98b87b7d5e5a8813f1bd79d 100644 (file)
@@ -287,7 +287,9 @@ $.widget("ui.slider", $.extend({}, $.ui.mouse, {
                if (valueMouseModStep > (this.options.step / 2))
                        normValue += this.options.step;
 
-               return normValue;
+               // Since JavaScript has problems with large floats, round
+               // the final value to 5 digits after the decimal point (see #4124)
+               return parseFloat(normValue.toFixed(5));
 
        },