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:
parent
4656dd0daa
commit
34ecc7c156
@ -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,
|
||||
|
@ -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', {
|
||||
|
Loading…
x
Reference in New Issue
Block a user