View on GitHub

web3js-cn

web3.toBigNumber

将给定的数字或十六进制字符串转为BigNumber。

调用:

web3.toBigNumber(value)

参数:

返回值:

示例:

var value = web3.toBigNumber('200000000000000000000001');
console.log(value); // instanceOf BigNumber
console.log(value.toNumber()); // 2.0000000000000002e+23
console.log(value.toString(10)); // '200000000000000000000001'

教程推荐: