src-lite: totalDifficultyFilter filter added

pull/5/head
hackyminer 7 years ago committed by EOS Classic
parent 838fff5423
commit 1c551e4a99
No known key found for this signature in database
GPG Key ID: 0D626A44301D8C5E
  1. 15
      src-lite/js/filters.js
  2. 2
      src-lite/views/index.jade

@ -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>');
};
}])
.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) {
return function(version) {
if(typeof version !== 'undefined')

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

Loading…
Cancel
Save