Permalink
Browse files

Fix nethash, miner hash and estimation (#82)

  • Loading branch information...
1 parent 90ea0df commit ba4746c99b144bd8d47a1ae9ed55bca75540e95c @sammy007 sammy007 committed with Sep 25, 2016
Showing with 5 additions and 5 deletions.
  1. +2 −2 lib/api.js
  2. +3 −3 website_example/pages/home.html
View
@@ -173,8 +173,8 @@ function getPublicPorts(ports){
function getReadableHashRateString(hashrate){
var i = 0;
var byteUnits = [' H', ' KH', ' MH', ' GH', ' TH', ' PH' ];
- while (hashrate > 1024){
- hashrate = hashrate / 1024;
+ while (hashrate > 1000){
+ hashrate = hashrate / 1000;
i++;
}
return hashrate.toFixed(2) + byteUnits[i];
@@ -267,8 +267,8 @@ <h4 class="yourStats">Payments</h4>
function getReadableHashRateString(hashrate){
var i = 0;
var byteUnits = [' H', ' KH', ' MH', ' GH', ' TH', ' PH' ];
- while (hashrate > 1024){
- hashrate = hashrate / 1024;
+ while (hashrate > 1000){
+ hashrate = hashrate / 1000;
i++;
}
return hashrate.toFixed(2) + byteUnits[i];
@@ -324,7 +324,7 @@ <h4 class="yourStats">Payments</h4>
function calcEstimateProfit(){
try {
- var rateUnit = Math.pow(1024,parseInt($('#calcHashUnit').data('mul')));
+ var rateUnit = Math.pow(1000,parseInt($('#calcHashUnit').data('mul')));
var inp2 = parseFloat($('#calcHashRate').val()) * rateUnit;
var resl = 16 / ((lastStats.network.difficulty / inp2) / 86400);
if (!isNaN(resl)) {

0 comments on commit ba4746c

Please sign in to comment.