From 516aad3e675e1a7509aa5361865af34732c7f9c0 Mon Sep 17 00:00:00 2001 From: sairajzero Date: Fri, 13 Dec 2019 15:02:49 +0530 Subject: [PATCH] bug fix: check balance Fixed : check balance not showing correctly with interger amounts --- FLO_webWallet_mainnet.html | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/FLO_webWallet_mainnet.html b/FLO_webWallet_mainnet.html index 38804fd..e6dc981 100644 --- a/FLO_webWallet_mainnet.html +++ b/FLO_webWallet_mainnet.html @@ -1948,7 +1948,7 @@
Available balance
0 - + FLO(s)
To send FLO data, make sure you have enough balance.
@@ -2431,21 +2431,12 @@ loading.classList.add('show', 'spin'); floWebWallet.getBalance(x.value).then((retrievedBal) => { let parts = retrievedBal.toString().split("."), - floatPart = parts.pop(), - intPart = parts.pop(); - if (intPart === undefined) { - intPartText.textContent = '0'; - } else { - if (retrievedBal < 0.005) { - intPartText.textContent = `Insufficient Balance`; - floatPartText.textContent = ''; - } else { - intPartText.textContent = intPart; - floatPartText.innerHTML = `.${floatPart} FLOs`; - document.getElementById('sdright').setAttribute('style', - 'pointer-events: all; opacity: 1') - } - } + floatPart = parts[1], + intPart = parts[0]; + intPartText.textContent = intPart; + if(floatPart) + floatPartText.textContent = `.${floatPart}`; + document.getElementById('sdright').setAttribute('style', 'pointer-events: all; opacity: 1') loading.classList.remove('show', 'spin'); }).catch((error) => { console.log(error);