Rounding up

Hi all,

I was wondering if there was an easy way to round all numbers up. I know there is the round() operator but I would like any number with a decimal behind it to be rounded up to the next whole number, ie 4.2 should round up to 5 etc.

Thanks for the help!

Lisa

*set temp2 (temp1 modulo 1)
*if temp2 >= 0.5
    *set temp1 (round(temp1))
*if temp2 < 0.5
    *set temp1 ((round(temp1)+1))

This should work. temp1 is the variable to round up and temp2 is just a temp variable.

4 Likes

That should do it!

Thanks!

1 Like

This topic was automatically closed 24 hours after the last reply. If you want to reopen your WiP, contact the moderators.