1
0
mirror of https://github.com/GOSTSec/gostexplr synced 2025-02-05 19:34:26 +00:00

parse values as float before using toFixed (for node 8+)

This commit is contained in:
R4SAS 2019-06-30 11:59:24 +00:00 committed by R4SAS
parent 4656dd0daa
commit 34ecc7c156
2 changed files with 2 additions and 2 deletions

View File

@ -28,7 +28,7 @@ router.get('/:hash', async function(req, res, next) {
const block = blockInstance.toJSON();
block.confirmations = lastBlock.maxheight - block.height + 1;
block.time = block.time.toUTCString();
block.difficulty = block.difficulty.toFixed(8);
block.difficulty = parseFloat(block.difficulty).toFixed(8);
block.hashrate = block.hashrate.toLocaleString() + " H/s";
res.render('block', {
block,

View File

@ -24,7 +24,7 @@ router.get('/', async function(req, res, next) {
});
blocks.forEach(function(arrayItem) {
arrayItem.ago = arrayItem.time.toUTCString().substring(5);
arrayItem.difficulty = arrayItem.difficulty.toFixed(8);
arrayItem.difficulty = parseFloat(arrayItem.difficulty).toFixed(8);
arrayItem.hashrate = formatRate(arrayItem.hashrate, 4);
});
res.render('index', {