Browse Source

Merge pull request #2168 from aaroncox/master

Corrected order of operations to enable precision (rounding).
pull/2183/head
Jack Lukic 9 years ago
parent
commit
2ad584f690
1 changed files with 3 additions and 3 deletions
  1. 6
      src/definitions/modules/progress.js

6
src/definitions/modules/progress.js

@ -236,7 +236,7 @@ $.fn.progress = function(parameters) {
if(settings.precision === 0) {
return Math.round(displayPercent);
}
return Math.round(displayPercent * (10 * settings.precision) / (10 * settings.precision) );
return Math.round(displayPercent * (10 * settings.precision)) / (10 * settings.precision);
},
percent: function() {
@ -361,11 +361,11 @@ $.fn.progress = function(parameters) {
percent = Math.round(percent);
}
else {
percent = Math.round(percent * (10 * settings.precision) / (10 * settings.precision) );
percent = Math.round(percent * (10 * settings.precision)) / (10 * settings.precision);
}
module.percent = percent;
if(module.total) {
module.value = Math.round( (percent / 100) * module.total);
module.value = Math.round( (percent / 100) * module.total * (10 * settings.precision)) / (10 * settings.precision);
}
else if(settings.limitValues) {
module.value = (module.value > 100)

Loading…
Cancel
Save