Skip to content

Commit

Permalink
Fix hashrate units
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario S committed Nov 2, 2016
1 parent 35a3af1 commit 8f98f17
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/js/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,22 @@ 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';
}

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

0 comments on commit 8f98f17

Please sign in to comment.