src-lite: totalDifficultyFilter filter added

This commit is contained in:
hackyminer 2018-04-05 18:41:32 +09:00 committed by EOS Classic
parent 838fff5423
commit 1c551e4a99
No known key found for this signature in database
GPG Key ID: 0D626A44301D8C5E
2 changed files with 16 additions and 1 deletions

View File

@ -54,6 +54,21 @@ angular.module('netStatsApp.filters', [])
return $sce.trustAsHtml('<span class="small">' + filter('number')(result.toFixed(1)) + ' <span class="small-hash">' + unit + 'H/s</span></span>'); return $sce.trustAsHtml('<span class="small">' + filter('number')(result.toFixed(1)) + ' <span class="small-hash">' + unit + 'H/s</span></span>');
}; };
}]) }])
.filter('totalDifficultyFilter', function() {
return function(hashes) {
var result = hashes;
var units = ['', 'K', 'M', 'G', 'T', 'P'];
var unit = '';
for(var i = 1; result > 1000; i++)
{
result /= 1000;
unit = units[i];
}
return result.toFixed(2) + ' ' + unit + 'H';
};
})
.filter('nodeVersion', function($sce) { .filter('nodeVersion', function($sce) {
return function(version) { return function(version) {
if(typeof version !== 'undefined') if(typeof version !== 'undefined')

View File

@ -52,7 +52,7 @@ block content
div.big-details-holder div.big-details-holder
span.small-title difficulty span.small-title difficulty
span.big-details span.big-details
span.small-hash {{ lastDifficulty | number }} span.small-hash {{ lastDifficulty | totalDifficultyFilter }}
div.clearfix div.clearfix
div.clearfix div.clearfix