Skip to content

Commit

Permalink
Merge pull request #13 from davglass/counter
Browse files Browse the repository at this point in the history
Fixed logic bug that caused bar to jump one extra space at the end
  • Loading branch information
tj committed Sep 19, 2012
2 parents 2b48b1d + 04025b0 commit 55178e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/node-progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 55178e9

Please sign in to comment.