From fd37f5db65f2abae1bfe6b07b91d41a153f16ba7 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Sun, 7 Aug 2016 17:23:35 -0700 Subject: Add fix for zero balance shorten. --- ui/app/util.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ui/app') 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) -- cgit v1.2.3