aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/util.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-06-22 04:56:04 +0800
committerDan Finlay <dan@danfinlay.com>2016-06-22 04:56:04 +0800
commit8fde8a8921135112ccfdd13ce6b009755b5f71ed (patch)
treecd4ceb1dcd74a601506f92e5669e3022ca800c0c /ui/app/util.js
parentab15b4c8259d6f6c5ae9d1e51548d73cfc1c67cb (diff)
downloadtangerine-wallet-browser-8fde8a8921135112ccfdd13ce6b009755b5f71ed.tar
tangerine-wallet-browser-8fde8a8921135112ccfdd13ce6b009755b5f71ed.tar.gz
tangerine-wallet-browser-8fde8a8921135112ccfdd13ce6b009755b5f71ed.tar.bz2
tangerine-wallet-browser-8fde8a8921135112ccfdd13ce6b009755b5f71ed.tar.lz
tangerine-wallet-browser-8fde8a8921135112ccfdd13ce6b009755b5f71ed.tar.xz
tangerine-wallet-browser-8fde8a8921135112ccfdd13ce6b009755b5f71ed.tar.zst
tangerine-wallet-browser-8fde8a8921135112ccfdd13ce6b009755b5f71ed.zip
Manually linted
Diffstat (limited to 'ui/app/util.js')
-rw-r--r--ui/app/util.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/ui/app/util.js b/ui/app/util.js
index de631dba9..db12a1282 100644
--- a/ui/app/util.js
+++ b/ui/app/util.js
@@ -84,13 +84,13 @@ function weiToEth (bn) {
// Takes hex, returns [beforeDecimal, afterDecimal]
function parseBalance (balance) {
- let beforeDecimal, afterDecimal
- let wei = numericBalance(balance).toString()
- let trailingZeros = /0+$/
+ var beforeDecimal, afterDecimal
+ const wei = numericBalance(balance).toString()
+ const trailingZeros = /0+$/
- beforeDecimal = wei.length > 18 ? wei.slice(0, wei.length - 18) : '0'
- afterDecimal = ("000000000000000000" + wei).slice(-18).replace(trailingZeros, "")
- if(afterDecimal == ""){afterDecimal = "0" }
+ beforeDecimal = wei.length > 18 ? wei.slice(0, wei.length - 18) : '0'
+ afterDecimal = ('000000000000000000' + wei).slice(-18).replace(trailingZeros, '')
+ if (afterDecimal === '') { afterDecimal = '0' }
return [beforeDecimal, afterDecimal]
}
@@ -161,7 +161,7 @@ function readableDate (ms) {
var minutes = '0' + date.getMinutes()
var seconds = '0' + date.getSeconds()
- var date = `${month}/${day}/${year}`
+ var dateStr = `${month}/${day}/${year}`
var time = `${hours}:${minutes.substr(-2)}:${seconds.substr(-2)}`
- return `${date} ${time}`
+ return `${dateStr} ${time}`
}