How to round down a number after division (fraction)?

Is there method in BN object or example of implemented code where I can check how to do round down a number after division ?

1 Like

The integer math in Sway will automatically round down for you when doing division, for example:
log(100 / 7); // gives 14, not 14.285714286
log(100 / 6); // gives 16, not 16.666666667. (Note that it doesn’t round up to 17)

If you need something different, perhaps you can share an example of your specific use case.

2 Likes