Skip to content

How to Convert BigNumber to Int/Number in Ethers/Web3

If you have a BigNumber when using web3, then you can convert this to a regular Javascript Number using the ethers library as follows:

ethers.BigNumber.from(max).toNumber()
Code language: JavaScript (javascript)

Ethers is a complete Ethereum library and wallet implementation in Javascript.

See also  Finding a Needle in a Haystack in Java
Tags:
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x