Added correct float to string conversion on frontend

pull/20/merge
fancoder 2014-08-19 14:29:04 +04:00
parent 53d3dd4fba
commit b5a3b0cba6
2 changed files with 6 additions and 2 deletions

View File

@ -256,6 +256,10 @@
});
}
function floatToString(float) {
return float.toFixed(6).replace(/[0\.]+$/, '');
}
var xhrPageLoading;
function routePage(loadedCallback) {

View File

@ -349,13 +349,13 @@
totalDonation += lastStats.config.donation[i];
}
totalFee += totalDonation;
updateText('poolDonations', totalDonation.toFixed(1) + '% to open-source devs');
updateText('poolDonations', floatToString(totalDonation) + '% to open-source devs');
}
else{
$('#donations').hide()
}
updateText('poolFee', totalFee + '%');
updateText('poolFee', floatToString(totalFee) + '%');
updateText('blockSolvedTime', getReadableTime(lastStats.network.difficulty / lastStats.pool.hashrate));