mirror of https://github.com/BTCPrivate/z-nomp.git
fixed bug in collection of per algo hash rate string
This commit is contained in:
parent
5918baac2f
commit
795b93e254
|
@ -157,7 +157,8 @@ module.exports = function(logger, portalConfig, poolConfigs){
|
|||
});
|
||||
|
||||
Object.keys(portalStats.algos).forEach(function(algo){
|
||||
algo.hashrateString = _this.getReadableHashRateString(algo.hashrate);
|
||||
var algoStats = portalStats.algos[algo];
|
||||
algoStats.hashrateString = _this.getReadableHashRateString(algoStats.hashrate);
|
||||
});
|
||||
|
||||
_this.stats = portalStats;
|
||||
|
@ -169,10 +170,10 @@ module.exports = function(logger, portalConfig, poolConfigs){
|
|||
|
||||
this.getReadableHashRateString = function(hashrate){
|
||||
var i = -1;
|
||||
var byteUnits = [' KH', ' MH', ' GH', ' TH', 'PH' ];
|
||||
var byteUnits = [ ' KH', ' MH', ' GH', ' TH', ' PH' ];
|
||||
do {
|
||||
hashrate = hashrate / 1024;
|
||||
i++;
|
||||
i++;
|
||||
} while (hashrate > 1024);
|
||||
return hashrate.toFixed(2) + byteUnits[i];
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue