status-bar
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -45,7 +45,9 @@ "use strict"; | ||
Formatter.prototype.storage = function (b, decimals){ | ||
return unit (~~b, storage, 1024, decimals === undefined ? 1 : decimals); | ||
return unit (Math.floor (b), storage, 1024, | ||
decimals === undefined ? 1 : decimals); | ||
}; | ||
Formatter.prototype.speed = function (bps, decimals){ | ||
return unit (~~bps, speeds, 1000, decimals === undefined ? 1 : decimals); | ||
return unit (Math.floor (bps), speeds, 1000, | ||
decimals === undefined ? 1 : decimals); | ||
}; | ||
@@ -58,4 +60,4 @@ | ||
var str; | ||
var min = ~~(s/60); | ||
var sec = ~~(s%60); | ||
var min = Math.floor (s/60); | ||
var sec = Math.floor (s%60); | ||
return zero (min) + ":" + zero (sec); | ||
@@ -225,3 +227,3 @@ }; | ||
//SMooth the speed | ||
//Smooth the speed | ||
speed = (1 - this._speedSmooth)*speed + this._speedSmooth*lastSpeed; | ||
@@ -235,6 +237,7 @@ | ||
this._stats.speed = | ||
~~((1 - this._avgSmooth)*speed + this._avgSmooth*avgSpeed); | ||
Math.floor ((1 - this._avgSmooth)*speed + this._avgSmooth*avgSpeed); | ||
//Remaining time | ||
this._stats.remainingTime = ~~(this._stats.remainingSize/avgSpeed) + 1 | ||
this._stats.remainingTime = | ||
Math.floor (this._stats.remainingSize/avgSpeed) + 1 | ||
} | ||
@@ -241,0 +244,0 @@ } |
{ | ||
"name": "status-bar", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "A status bar for file transfers", | ||
@@ -5,0 +5,0 @@ "keywords": ["status", "bar", "file", "transfer", "speed", "progress", |
@@ -162,3 +162,2 @@ status-bar | ||
- [StatusBar#cancel() : undefined](#statusbar_cancel) | ||
- [StatusBar#update(chunk) : undefined](#statusbar_update) | ||
@@ -165,0 +164,0 @@ __Properties__ |
16377
203
292