Closed ifavo closed 1 month ago
I am sorry, I was a bit too early, using parseFloat is an error I did and did not test in the ethers comparison. All good an no issue here. Sorry again.
Never less, I'm going to investigate a possible side effect because the bignumber.js
library backing the parseUnit has a global variable to set the precision, this could lead to side effects poking with the same library in other parts of a project using our SDK and bignumber.js
.
I created a second issue with reproduction code here: https://github.com/vechain/vechain-sdk-js/issues/928 - maybe best to handle it there?
This ticket is closed because investigation moved to https://github.com/orgs/vechain/projects/9/views/1?pane=issue&itemId=65498793 as suggested.
Description
I have a big int number that is converted correctly to a human readable version using
formatUnits
but when applyingparseUnits
on the same string, it does return a different number. There might be a rounding error at a certain point.Reproduction URL
No response
Reproduction steps
It results in:
398913019603365740000n
but should be398913019603365720000n
ethers
, which works correctly as expectedScreenshots
Logs
No response
OS
No response