From 705ad0197d49d94601d5f75a38f65c26303d51a0 Mon Sep 17 00:00:00 2001 From: Guillermo Alejandro Gallardo Diez Date: Sun, 5 Jan 2025 22:06:30 +0100 Subject: [PATCH] fix: display balance --- src/components/wallet-utilities/SendNear.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/wallet-utilities/SendNear.tsx b/src/components/wallet-utilities/SendNear.tsx index 91b599273..595d07e55 100644 --- a/src/components/wallet-utilities/SendNear.tsx +++ b/src/components/wallet-utilities/SendNear.tsx @@ -24,9 +24,8 @@ export const SendNear = () => { const loadBalance = async () => { try { const balanceYocto = await wallet.getBalance(signedAccountId); - const balance = parseFloat((BigInt(balanceYocto) / NEAR_NOMINATION).toString()); + const balance = Number((BigInt(balanceYocto) * BigInt(100000)) / NEAR_NOMINATION) / 100000; - console.log('balance', balanceYocto, balance); const requiredGas = 0.00005; const availableBalance = Math.max(balance - requiredGas, 0);