Stats fixes

This commit is contained in:
fxminer 2016-12-07 08:12:02 +01:00
parent fce319caeb
commit 59db03b524
3 changed files with 9 additions and 8 deletions

View File

@ -274,9 +274,10 @@ module.exports = function(logger, portalConfig, poolConfigs){
var i = -1;
var byteUnits = [ ' Sol',' KSol', ' MSol', ' GSol', ' TSol', ' PSol' ];
do {
hashrate = hashrate / 100000;
i++;
} while (hashrate > 1000);
hashrate = hashrate / 1024;
i++;
} while (hashrate > 1024);
return hashrate.toFixed(2) + byteUnits[i];
};

View File

@ -53,9 +53,9 @@
{{ for(var worker in it.stats.pools[pool].workers) { }}
{{var workerstat = it.stats.pools[pool].workers[worker];}}
<tr class="pure-table-odd">
<td>{{=worker}}</td>
<td>{{=Math.floor(workerstat.shares)}}</td>
<td>{{=Math.floor(workerstat.invalidshares)}}</td>
<td>...{{=worker.substr(20, 1000)}}</td>
<td>{{=Math.round(workerstat.shares * 100) / 100}}</td>
<td>{{=Math.round(workerstat.invalidshares * 100) / 100}}</td>
<td>{{? workerstat.shares > 0}} {{=Math.floor(10000 * workerstat.shares / (workerstat.shares + workerstat.invalidshares)) / 100}}% {{??}} 0% {{?}}</td>
<td>{{=workerstat.hashrateString}}</td>
</tr>

View File

@ -70,7 +70,7 @@ function buildChartData(){
function getReadableHashRateString(hashrate){
var i = -1;
var byteUnits = [ ' KH', ' MH', ' GH', ' TH', ' PH' ];
var byteUnits = [ ' Sol', ' KSol', ' MSol', ' GSol', ' TSol' ];
do {
hashrate = hashrate / 1024;
i++;