BigNumber.mulTruncate kind of operation #2456
marcelomorgado
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
You can add this to the prototype yourself, to access it, à la The goal of the ethers BigNumber is to be intentionally minimal though, since in the future it will be going away (in v7, ES2020 BigInt will have fairly wide support), so I don’t think it makes a lot of sense to add. Make sense? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Do you think that would make sense having these kind of BN operators? I mean, I have this kind of code a lot in my test cases, for instance:
amount.mul(fee).div(parseEther('1'))
that could be writtenamount.mulTruncate(fee)
we could have an interface like thismulTruncate(amount: BigNumber, divisorDecimals: BigNumber | number = 18)
WDYT?
Beta Was this translation helpful? Give feedback.
All reactions