diff options
author | Dan J Miller <danjm.com@gmail.com> | 2018-07-23 23:02:52 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-23 23:02:52 +0800 |
commit | 78a1bcfdec5fb5e416e1d43bf13c4fda11404ab6 (patch) | |
tree | fadeaefc8b4317b33dba95c26f0921b48a17f901 | |
parent | 7cca1460589f782a13b134e75b9602b67477b638 (diff) | |
parent | 3554292c022755f4198a5f864ad7054e3d5421d4 (diff) | |
download | tangerine-wallet-browser-78a1bcfdec5fb5e416e1d43bf13c4fda11404ab6.tar tangerine-wallet-browser-78a1bcfdec5fb5e416e1d43bf13c4fda11404ab6.tar.gz tangerine-wallet-browser-78a1bcfdec5fb5e416e1d43bf13c4fda11404ab6.tar.bz2 tangerine-wallet-browser-78a1bcfdec5fb5e416e1d43bf13c4fda11404ab6.tar.lz tangerine-wallet-browser-78a1bcfdec5fb5e416e1d43bf13c4fda11404ab6.tar.xz tangerine-wallet-browser-78a1bcfdec5fb5e416e1d43bf13c4fda11404ab6.tar.zst tangerine-wallet-browser-78a1bcfdec5fb5e416e1d43bf13c4fda11404ab6.zip |
Merge pull request #4852 from keyiiiii/fix-token-amount
Fix token amount
-rw-r--r-- | ui/app/token-util.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/ui/app/token-util.js b/ui/app/token-util.js index cd6a47dbc..0d4233766 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).toNumber() } |