diff --git a/routes/block.js b/routes/block.js index 79bc364..ae40108 100644 --- a/routes/block.js +++ b/routes/block.js @@ -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, diff --git a/routes/index.js b/routes/index.js index d231683..36c3021 100644 --- a/routes/index.js +++ b/routes/index.js @@ -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', {