(Fix) Error when using up to the max amount of decimals for token transfer#1576
(Fix) Error when using up to the max amount of decimals for token transfer#1576fernandomg merged 5 commits intodevelopmentfrom
Conversation
|
CLA Assistant Lite All Contributors have signed the CLA. |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
|
Travis automatic deployment: |
|
Travis automatic deployment: |
| return amountBN.toFixed(0, BigNumber.ROUND_DOWN) | ||
| } | ||
|
|
||
| return amountBN.toFixed() |
There was a problem hiding this comment.
Couldn't we just remove the IF and ensure that every number is rounded to have no decimals using ROUND_DOWN approximation?
There was a problem hiding this comment.
indeed! so simple now. Thanks.
|
Travis automatic deployment: |
|
Travis automatic deployment: |
|
Travis automatic deployment: |
|
Travis automatic deployment: |
|
@fernandomg nice. Thank you for adding the tests also |
|
Travis automatic deployment: |
|
Travis automatic deployment: |
|
Tested in this safe: https://pr1576--safereact.review.gnosisdev.com/rinkeby/app/#/safes/0x0BdeD4FaDffdb12240E27954264071442a26fd45/transactions I stored 0.000123123123123123 ETH in that safe Looks good to me |
This PR closes #1575, by fixing
toTokenUnitfunction decimals round.