Browse files

Merge pull request #13 from davglass/counter

Fixed logic bug that caused bar to jump one extra space at the end
  • Loading branch information...
2 parents 2b48b1d + 04025b0 commit 55178e9b45a2e5a7393b8796a16822efad3fd25d @tj tj committed Sep 19, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/node-progress.js
View
4 lib/node-progress.js
@@ -84,12 +84,12 @@ ProgressBar.prototype.tick = function(len, tokens){
var percent = this.curr / this.total * 100
, complete = Math.round(this.width * (this.curr / this.total))
- , incomplete = this.width - complete
+ , incomplete
, elapsed = new Date - this.start
, eta = elapsed * (this.total / this.curr - 1)
complete = Array(complete).join(this.chars.complete);
- incomplete = Array(incomplete).join(this.chars.incomplete);
+ incomplete = Array(this.width - complete.length).join(this.chars.incomplete);
var str = this.fmt
.replace(':bar', complete + incomplete)

0 comments on commit 55178e9

Please sign in to comment.