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()

<a href="https://github.com/ethers-io/ethers.js/" target="_blank" rel="noreferrer noopener nofollow">Ethers</a> is a complete Ethereum library and wallet implementation in Javascript.