From 5522c76d0af0b672873ff3d1a69eb3dc4f0cb0f8 Mon Sep 17 00:00:00 2001 From: Tino Rusch Date: Wed, 19 Feb 2025 11:36:38 +0100 Subject: [PATCH 1/2] remove truncation of blockspeed to more accurately estimate --- src/modules/[chain]/block/[height].vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/[chain]/block/[height].vue b/src/modules/[chain]/block/[height].vue index 34e55542..acced43b 100644 --- a/src/modules/[chain]/block/[height].vue +++ b/src/modules/[chain]/block/[height].vue @@ -38,7 +38,7 @@ const remainingBlocks = computed(() => { }) const estimateTime = computed(() => { - const seconds = remainingBlocks.value * Number((store.blocktime / 1000).toFixed()) * 1000 + const seconds = remainingBlocks.value * store.blocktime return seconds }) From c42bdef5302ab1c40e659b38d71c6474af863a8a Mon Sep 17 00:00:00 2001 From: Tino Rusch Date: Thu, 20 Feb 2025 08:52:41 +0100 Subject: [PATCH 2/2] use toFixed(2) to limit decimals to two places. --- src/modules/[chain]/block/[height].vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/[chain]/block/[height].vue b/src/modules/[chain]/block/[height].vue index acced43b..295580ef 100644 --- a/src/modules/[chain]/block/[height].vue +++ b/src/modules/[chain]/block/[height].vue @@ -38,7 +38,7 @@ const remainingBlocks = computed(() => { }) const estimateTime = computed(() => { - const seconds = remainingBlocks.value * store.blocktime + const seconds = Number((remainingBlocks.value * store.blocktime).toFixed(2)) return seconds })