I'm trying to parse some ETH amounts to display them on client side, using ethers v6.11.1
but I get this error. The same code used to work fine with ethers v5
, I have checked the type of value
, and it is string
.
const parseAmount = (value: string): number => {
return ethers.toNumber(value) * 10 ** -18;
};
Error:
TypeError: overflow (argument="value", value=21150000000000000, code=INVALID_ARGUMENT, version=6.11.1)