From fe21c9687a58b7eadabd104600e666dbb0df52cb Mon Sep 17 00:00:00 2001 From: Aaron Cox Date: Mon, 9 Sep 2024 19:18:48 -0700 Subject: [PATCH] Use Big.js to create a non scientific notation version of the string --- src/lib/components/input/asset.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/input/asset.svelte b/src/lib/components/input/asset.svelte index 1e9c4999..65353ecb 100644 --- a/src/lib/components/input/asset.svelte +++ b/src/lib/components/input/asset.svelte @@ -42,7 +42,7 @@ let number = $derived(input && satisfiesNumber ? Big(input) : Big(0)); /** The number of decimal places used in the string input */ - const decimals = $derived(String(number).split('.')[1]?.length || 0); + const decimals = $derived(number.toFixed().split('.')[1]?.length || 0); /** The symbol of the asset */ let symbol: Asset.Symbol = $state(_value.symbol);