UNPKG
spacylabs-rhino
Version:
latest (5.1.11)
5.1.11
5.1.10
5.1.9
5.1.8
5.1.7
5.1.6
5.1.5
5.1.1
github.com/rhinofi/client-js
spacylabs-rhino
/
src
/
lib
/
dvf
/
token
/
toBaseUnitAmount.js
12 lines
(9 loc)
•
250 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
const
BN
=
require
(
'bignumber.js'
)
module
.
exports
=
(
dvf, token, amount
) =>
{
const
tokenInfo = dvf.
token
.
getTokenInfo
(token)
return
new
BN
(
10
) .
pow
(tokenInfo.
decimals
) .
times
(amount) .
integerValue
(
BN
.
ROUND_FLOOR
) .
toString
() }