aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/util.js
diff options
context:
space:
mode:
authorFrankie <frankie.pangilinan@consensys.net>2016-08-19 02:06:32 +0800
committerFrankie <frankie.pangilinan@consensys.net>2016-08-19 02:06:32 +0800
commitefa61f2cf892eb1383fcfacd60d906e76dbaa757 (patch)
tree4e19f1abbadc02f861f0b54027954bf9cb6b5fac /ui/app/util.js
parent752d16f6c072b0dd54eb245209881a25ff06cb8e (diff)
parent90d6bec3ed51ba4b2d4696132642a4d97712dec9 (diff)
downloadtangerine-wallet-browser-efa61f2cf892eb1383fcfacd60d906e76dbaa757.tar
tangerine-wallet-browser-efa61f2cf892eb1383fcfacd60d906e76dbaa757.tar.gz
tangerine-wallet-browser-efa61f2cf892eb1383fcfacd60d906e76dbaa757.tar.bz2
tangerine-wallet-browser-efa61f2cf892eb1383fcfacd60d906e76dbaa757.tar.lz
tangerine-wallet-browser-efa61f2cf892eb1383fcfacd60d906e76dbaa757.tar.xz
tangerine-wallet-browser-efa61f2cf892eb1383fcfacd60d906e76dbaa757.tar.zst
tangerine-wallet-browser-efa61f2cf892eb1383fcfacd60d906e76dbaa757.zip
Merge branch 'master' into shapeshiftTx
Diffstat (limited to 'ui/app/util.js')
-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..e1fd6e399 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)