Single post in A Somewhat Extensive Guide to BBCodes
Forum Index > PokéFarm > Guides > A Somewhat Extensive Guide to BBCodes >
QUOTE originally posted by omg
im sorry if this has been asked before, but i was wondering if theres any way to round the results of the math bbcode, just to the nearest whole number?
or is there a way to even just hide the numbers after a decimal altogether, and just show the whole number?
its okay if not, its easy to just make do with what we've got now ofc ^^ was just curious if anyone had pointers in how i could play with that!!
[math]3.55/100[/math]
which results in: 0.04
Then to restore it back to its original state, we reverse the division by multiplying by 100. We have to do this in a separate math block, because it does not round until it calculates the full result of the math block.
Our end expression is:
[math][math]3.55/100[/math]*100[/math]
which results in: 4
So to round any expression to the nearest whole number, we can use:
[math][math](any math expression)/100[/math]*100[/math]
If I forget to respond to a post or trade please PM me! I may have forgotten to subscribe.
Avatar from Pokémon Showdown April Fools Day sprites, recolored by me.