From 525a61dff90373e866d5155dc3854aa92e6fc5c7 Mon Sep 17 00:00:00 2001 From: jlukic Date: Tue, 19 May 2015 18:20:49 -0400 Subject: [PATCH] Reverse ternary to allow falsey values to evaluate as no precision --- src/definitions/modules/progress.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/definitions/modules/progress.js b/src/definitions/modules/progress.js index d8c16689d..25e117712 100644 --- a/src/definitions/modules/progress.js +++ b/src/definitions/modules/progress.js @@ -233,9 +233,9 @@ $.fn.progress = function(parameters) { ? (barWidth / totalWidth * 100) : module.percent ; - return (settings.precision === 0) - ? Math.round(displayPercent) - : Math.round(displayPercent * (10 * settings.precision)) / (10 * settings.precision) + return (settings.precision > 0) + ? Math.round(displayPercent * (10 * settings.precision)) / (10 * settings.precision) + : Math.round(displayPercent) ; }, @@ -357,15 +357,15 @@ $.fn.progress = function(parameters) { percent = percent * 100; } // round percentage - percent = (settings.precision === 0) - ? Math.round(percent) - : Math.round(percent * (10 * settings.precision)) / (10 * settings.precision) + percent = (settings.precision > 0) + ? Math.round(percent * (10 * settings.precision)) / (10 * settings.precision) + : Math.round(percent) ; module.percent = percent; if(module.total) { - module.value = (settings.precision === 0) - ? Math.round( (percent / 100) * module.total * 10) / 10 - : Math.round( (percent / 100) * module.total * (10 * settings.precision)) / (10 * settings.precision) + module.value = (settings.precision > 0) + ? Math.round( (percent / 100) * module.total * (10 * settings.precision)) / (10 * settings.precision) + : Math.round( (percent / 100) * module.total * 10) / 10 ; } else if(settings.limitValues) {