aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/util.js
diff options
context:
space:
mode:
authorAust <AustP@users.noreply.github.com>2016-07-18 23:54:06 +0800
committerGitHub <noreply@github.com>2016-07-18 23:54:06 +0800
commit061633bf6725422bfb3f35bf3fdb17b514669357 (patch)
tree71cc5af2b8e3bf56ae620f728f40d9a951e093f7 /ui/app/util.js
parent667483ac2037bef5b412ce33f0d9bb0605d6c13b (diff)
downloadtangerine-wallet-browser-061633bf6725422bfb3f35bf3fdb17b514669357.tar
tangerine-wallet-browser-061633bf6725422bfb3f35bf3fdb17b514669357.tar.gz
tangerine-wallet-browser-061633bf6725422bfb3f35bf3fdb17b514669357.tar.bz2
tangerine-wallet-browser-061633bf6725422bfb3f35bf3fdb17b514669357.tar.lz
tangerine-wallet-browser-061633bf6725422bfb3f35bf3fdb17b514669357.tar.xz
tangerine-wallet-browser-061633bf6725422bfb3f35bf3fdb17b514669357.tar.zst
tangerine-wallet-browser-061633bf6725422bfb3f35bf3fdb17b514669357.zip
Make zero balance display 0. Fixes #449
Diffstat (limited to 'ui/app/util.js')
-rw-r--r--ui/app/util.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/ui/app/util.js b/ui/app/util.js
index a08006077..4655d63dc 100644
--- a/ui/app/util.js
+++ b/ui/app/util.js
@@ -123,7 +123,11 @@ function generateBalanceObject (formattedBalance, decimalsToKeep = 1) {
var shortBalance = shortenBalance(balance, decimalsToKeep)
if (beforeDecimal === '0' && afterDecimal.substr(0, 5) === '00000') {
- balance = '<1.0e-5'
+ if (afterDecimal == 0) {
+ balance = '0'
+ } else {
+ balance = '<1.0e-5'
+ }
} else if (beforeDecimal !== '0') {
balance = `${beforeDecimal}.${afterDecimal.slice(0, decimalsToKeep)}`
}