How to write big numbers into a migrations script?

If you use the version of the web3 is 1.0, you can use web3.utils.toBN() in the web3,

web3.utils.toBN('1234000000000000000000').mul(web3.utils.toBN('123000000000000000000')).toString();

and also you can use web3.utils.toWei(1234, 'ether') => 1234000000000000000000
But I would like to use bn.js or bignumber.js.

1 Like