Skip to content

Commit

Permalink
fix token amount
Browse files Browse the repository at this point in the history
  • Loading branch information
keyiiiii committed Jul 23, 2018
1 parent 7cca146 commit 79976b7
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).toString()
}


Expand Down

0 comments on commit 79976b7

Please sign in to comment.