From 76a2637590d43c3bd8878f88d72718f7ed09d2a2 Mon Sep 17 00:00:00 2001 From: TheJltres Date: Tue, 30 Jun 2020 14:18:47 +0200 Subject: [PATCH] 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 --- dist/components/slider.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dist/components/slider.js b/dist/components/slider.js index e4974dcdf3..206121ce45 100644 --- a/dist/components/slider.js +++ b/dist/components/slider.js @@ -789,9 +789,8 @@ $.fn.slider = function(parameters) { } // Use precision to avoid ugly Javascript floating point rounding issues // (like 35 * .01 = 0.35000000000000003) - difference = Math.round(difference * precision) / precision; module.verbose('Cutting off additional decimal places'); - return difference + module.get.min(); + return Math.round((difference + module.get.min()) * precision) / precision; }, keyMovement: function(event) { var