Hey i am trying to get contract decimal, it returns something like this "0x313ce567". Does anyone know how can i convert it to human-readable value using ethersjs ?
Jul 15, 2022, 3:02 PM
parseInt(Number("0x313ce567"))
Have you tried this?
Have you tried this?
Jul 15, 2022, 3:12 PM
that is interesting it returns 826074471
even if decimal is 9 or 18
it return same number
Jul 15, 2022, 3:23 PM
ethers.utils.formatUnits(yourValue,0) ?
Jul 15, 2022, 3:25 PM
yeah it return same number
826074471
it worked lol
❤️
thanks for help
Jul 15, 2022, 3:31 PM
This is for creating a raw transaction. The data you received over there is transaction data, not the function call result
Jul 15, 2022, 4:36 PM
e.g. the same transfer of ERC20
was performed twice. But the first tx costed more gas, than the second one
ok, gotcha
Jul 15, 2022, 4:47 PM