From 8f110fedbe867826d524f2faf66cf2850be9658a Mon Sep 17 00:00:00 2001 From: Kristian Trenskow Date: Thu, 23 Feb 2017 09:09:22 +0100 Subject: [PATCH] Math.floor percent. --- lib/node-progress.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node-progress.js b/lib/node-progress.js index 6480ffa..e29dfd7 100644 --- a/lib/node-progress.js +++ b/lib/node-progress.js @@ -126,7 +126,7 @@ ProgressBar.prototype.render = function (tokens) { var ratio = this.curr / this.total; ratio = Math.min(Math.max(ratio, 0), 1); - var percent = ratio * 100; + var percent = Math.floor(ratio * 100); var incomplete, complete, completeLength; var elapsed = new Date - this.start; var eta = (percent == 100) ? 0 : elapsed * (this.total / this.curr - 1);