Skip to content

Commit

Permalink
Fix round method, see issue #137
Browse files Browse the repository at this point in the history
  • Loading branch information
triole committed May 29, 2019
1 parent 9ba3bae commit b58ed5c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ angular.module('project_questions')
max = parseFloat(attrs.maxValue);

var value = 0.01 * parseFloat(val) * (max - min) + min;
return Math.round(value / attrs.step) * attrs.step;
var d = 100 * attrs.step;
return Math.round(value * d) / d;
});

ngModelController.$formatters.push(function(val) {
Expand Down

0 comments on commit b58ed5c

Please sign in to comment.