Closed palinko91 closed 5 months ago
Bigger numbers for baseAmount = 10000000000000000000 not going to work, because the .toNumber() will error out.
Minimal example to reproduce the error: new BN("10000000000000000000").toNumber()
new BN("10000000000000000000").toNumber()
So it's better to keep dividing while in BN type and only convert to number when it's much lower quantity.
Since the previous demo did not clarify the meaning of 6 in division, I have updated the demo. Thank you very much for your advice.
Bigger numbers for baseAmount = 10000000000000000000 not going to work, because the .toNumber() will error out.
Minimal example to reproduce the error:
new BN("10000000000000000000").toNumber()
So it's better to keep dividing while in BN type and only convert to number when it's much lower quantity.