aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
author板橋 清信 <itahashi_kiyonobu@cyberagent.co.jp>2018-07-23 15:28:45 +0800
committer板橋 清信 <itahashi_kiyonobu@cyberagent.co.jp>2018-07-23 15:28:45 +0800
commit79976b702685dd83d356e18fbb01e273e04f2fbf (patch)
tree1557f611455a6f8f5b9d44fe061d2822e12a98a7 /ui
parent7cca1460589f782a13b134e75b9602b67477b638 (diff)
downloadtangerine-wallet-browser-79976b702685dd83d356e18fbb01e273e04f2fbf.tar
tangerine-wallet-browser-79976b702685dd83d356e18fbb01e273e04f2fbf.tar.gz
tangerine-wallet-browser-79976b702685dd83d356e18fbb01e273e04f2fbf.tar.bz2
tangerine-wallet-browser-79976b702685dd83d356e18fbb01e273e04f2fbf.tar.lz
tangerine-wallet-browser-79976b702685dd83d356e18fbb01e273e04f2fbf.tar.xz
tangerine-wallet-browser-79976b702685dd83d356e18fbb01e273e04f2fbf.tar.zst
tangerine-wallet-browser-79976b702685dd83d356e18fbb01e273e04f2fbf.zip
fix token amount
Diffstat (limited to 'ui')
-rw-r--r--ui/app/token-util.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/ui/app/token-util.js b/ui/app/token-util.js
index cd6a47dbc..4e3c6c78a 100644
--- a/ui/app/token-util.js
+++ b/ui/app/token-util.js
@@ -1,5 +1,6 @@
const log = require('loglevel')
const util = require('./util')
+const BigNumber = require('bignumber.js')
function tokenInfoGetter () {
const tokens = {}
@@ -43,9 +44,7 @@ async function getSymbolAndDecimals (tokenAddress, existingTokens = []) {
function calcTokenAmount (value, decimals) {
const multiplier = Math.pow(10, Number(decimals || 0))
- const amount = Number(value / multiplier)
-
- return amount
+ return new BigNumber(value).div(multiplier).toString()
}