Skip to content

Commit b385330

Browse files
authored
fix(slider): operation sometimes returns not rounded value
I changed the return result, beacause of this https://floating-point-gui.de/ variables values where rounded when they arrive thanks to rounded difference, but the result of difference and module.get.min whas not rounded
1 parent 76a2637 commit b385330

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/definitions/modules/slider.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -789,9 +789,8 @@ $.fn.slider = function(parameters) {
789789
}
790790
// Use precision to avoid ugly Javascript floating point rounding issues
791791
// (like 35 * .01 = 0.35000000000000003)
792-
difference = Math.round(difference * precision) / precision;
793792
module.verbose('Cutting off additional decimal places');
794-
return difference + module.get.min();
793+
return Math.round((difference + module.get.min()) * precision) / precision;
795794
},
796795
keyMovement: function(event) {
797796
var

0 commit comments

Comments
 (0)