Skip to content

Commit

Permalink
Net Hashrate
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario S committed Nov 3, 2016
1 parent 8f98f17 commit 6299fe0
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions src/js/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ angular.module('netStatsApp.filters', [])
unit = 'T';
}


if(hashes >= Math.pow(1000, 5) && hashes < Math.pow(1000, 6)) {
result = hashes / Math.pow(1000, 5);
unit = 'P';
Expand All @@ -106,7 +105,12 @@ angular.module('netStatsApp.filters', [])
unit = 'Z';
}

return $sce.trustAsHtml('<span class="small">' + filter('number')(result.toFixed(1)) + ' <span class="small-hash">' + unit + 'H/s</span></span>');
if(hashes >= Math.pow(1000, 8) && hashes < Math.pow(1000, 9)) {
result = hashes / Math.pow(1000, 8);
unit = 'Y';
}

return $sce.trustAsHtml('<span class="small">' + filter('number')(result.toFixed(2)) + ' <span class="small-hash">' + unit + 'H/s</span></span>');
};
}])
.filter('totalDifficultyFilter', function() {
Expand Down Expand Up @@ -417,6 +421,27 @@ angular.module('netStatsApp.filters', [])
unit = 'T';
}

if(hashes >= Math.pow(1000, 5) && hashes < Math.pow(1000, 6)) {
result = hashes / Math.pow(1000, 5);
unit = 'P';
}

if(hashes >= Math.pow(1000, 6) && hashes < Math.pow(1000, 7)) {
result = hashes / Math.pow(1000, 6);
unit = 'E';
}

if(hashes >= Math.pow(1000, 7) && hashes < Math.pow(1000, 8)) {
result = hashes / Math.pow(1000, 7);
unit = 'Z';
}

if(hashes >= Math.pow(1000, 8) && hashes < Math.pow(1000, 9)) {
result = hashes / Math.pow(1000, 8);
unit = 'Y';
}


if( !isMining )
return $sce.trustAsHtml(filter('number')(result.toFixed(1)) + ' <span class="small-hash">' + unit + 'H/s</span>');

Expand Down

0 comments on commit 6299fe0

Please sign in to comment.