Sanity check on FixedNumber use :-) Trying to use small percentages #2687
Unanswered
iangregsondev
asked this question in
Q&A
Replies: 0 comments
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.
-
Hi,
I was trying to workout a slippage of 0.1%, I had so many problems with BigNumber and then I found FixedNumber that everyone was talking about but I couldn't find anything concrete. So I have managed to do it - I think.
But I would appreciate if anybody can comment if I am doing it right ? Am I doing too much, re-inventing any wheel :-)
I thought it might serve as an example to others, if its correct :-) Or even better an example of what not to do, if I am completely off the mark.
Code is below, and here is my output from the code (i used a really small percentage to ensure I had no issues with rounding etc, probably no real world, 0.1% would be sufficient)
and code...
Beta Was this translation helpful? Give feedback.
All reactions