mirror of https://github.com/BTCPrivate/z-nomp.git
fixup! Bugfix: Hashrate incorrect
This commit is contained in:
parent
c640b4fbaf
commit
c83ed07049
|
@ -271,14 +271,12 @@ module.exports = function(logger, portalConfig, poolConfigs){
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getReadableHashRateString = function(hashrate){
|
this.getReadableHashRateString = function(hashrate){
|
||||||
var i = -1;
|
if (hashrate === 0)
|
||||||
var byteUnits = [ ' Sol',' KSol', ' MSol', ' GSol', ' TSol', ' PSol' ];
|
return '0 Sol';
|
||||||
do {
|
var byteUnits = [ ' Sol', ' KSol', ' MSol', ' GSol', ' TSol', ' PSol' ];
|
||||||
hashrate = (hashrate * 2) / 1000000;
|
hashrate = (hashrate * 2);
|
||||||
i++;
|
var i = Math.floor((Math.log(hashrate/1000) / Math.log(1000)) - 1);
|
||||||
} while (hashrate > 1000);
|
hashrate = (hashrate/1000) / Math.pow(1000, i + 1);
|
||||||
|
|
||||||
return hashrate.toFixed(2) + byteUnits[i];
|
return hashrate.toFixed(2) + byteUnits[i];
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -69,12 +69,12 @@ function buildChartData(){
|
||||||
}
|
}
|
||||||
|
|
||||||
function getReadableHashRateString(hashrate){
|
function getReadableHashRateString(hashrate){
|
||||||
var i = -1;
|
if (hashrate === 0)
|
||||||
var byteUnits = [ ' Sol',' KSol', ' MSol', ' GSol', ' TSol', ' PSol' ];
|
return '0 Sol';
|
||||||
do {
|
var byteUnits = [ ' Sol', ' KSol', ' MSol', ' GSol', ' TSol', ' PSol' ];
|
||||||
hashrate = (hashrate * 2) / 1000000;
|
hashrate = (hashrate * 2);
|
||||||
i++;
|
var i = Math.floor((Math.log(hashrate/1000) / Math.log(1000)) - 1);
|
||||||
} while (hashrate > 1000);
|
hashrate = (hashrate/1000) / Math.pow(1000, i + 1);
|
||||||
return Math.round(hashrate) + byteUnits[i];
|
return Math.round(hashrate) + byteUnits[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue