I have the requirement to extract plain integer from a smart contract function that returns a bigNumber. I'm trying to extract as seen below. Is this a good practice or a bad workaround? If its the latter, can someone suggest a better way of doing this?
const bal = parseInt(formatUnits(balance,"wei"));