Skip to content

Commit

Permalink
Merge pull request #4852 from keyiiiii/fix-token-amount
Browse files Browse the repository at this point in the history
Fix token amount
  • Loading branch information
danjm authored Jul 23, 2018
2 parents 7cca146 + 3554292 commit 78a1bcf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ui/app/token-util.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const log = require('loglevel')
const util = require('./util')
const BigNumber = require('bignumber.js')

function tokenInfoGetter () {
const tokens = {}
Expand Down Expand Up @@ -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()
}


Expand Down

0 comments on commit 78a1bcf

Please sign in to comment.