aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2016-08-08 08:23:35 +0800
committerKevin Serrano <kevgagser@gmail.com>2016-08-08 08:23:35 +0800
commitfd37f5db65f2abae1bfe6b07b91d41a153f16ba7 (patch)
treee3a3740969af6790f335abd261a5b2114b3de530 /ui
parent260de6532c50dceebee93acab70a3319afdb16fb (diff)
downloadtangerine-wallet-browser-fd37f5db65f2abae1bfe6b07b91d41a153f16ba7.tar
tangerine-wallet-browser-fd37f5db65f2abae1bfe6b07b91d41a153f16ba7.tar.gz
tangerine-wallet-browser-fd37f5db65f2abae1bfe6b07b91d41a153f16ba7.tar.bz2
tangerine-wallet-browser-fd37f5db65f2abae1bfe6b07b91d41a153f16ba7.tar.lz
tangerine-wallet-browser-fd37f5db65f2abae1bfe6b07b91d41a153f16ba7.tar.xz
tangerine-wallet-browser-fd37f5db65f2abae1bfe6b07b91d41a153f16ba7.tar.zst
tangerine-wallet-browser-fd37f5db65f2abae1bfe6b07b91d41a153f16ba7.zip
Add fix for zero balance shorten.
Diffstat (limited to 'ui')
-rw-r--r--ui/app/util.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/ui/app/util.js b/ui/app/util.js
index 04ebcecdb..eac895ddd 100644
--- a/ui/app/util.js
+++ b/ui/app/util.js
@@ -145,6 +145,8 @@ function shortenBalance (balance, decimalsToKeep = 1) {
} else if (convertedBalance > 1000) {
truncatedValue = (balance / 1000).toFixed(decimalsToKeep)
return `>${truncatedValue}k`
+ } else if (convertedBalance == 0) {
+ return '0'
} else if (convertedBalance < 1) {
var exponent = balance.match(/\.0*/)[0].length
truncatedValue = (convertedBalance * Math.pow(10, exponent)).toFixed(decimalsToKeep)