Game Development Community

Rounding Numbers

by Steven Hine · in Torque Game Builder · 05/31/2008 (9:37 am) · 3 replies

Is there a function to round number up or down?

Like this:

83.2 = 83
83.6 = 84

Or could I just drop the decimal all together?

#1
05/31/2008 (2:22 pm)
The function "mRound" will do it.
#2
06/01/2008 (8:06 am)
Sweet, thank you!
#3
06/01/2008 (12:21 pm)
If, for any reason, you need to play with the point at which you rand up/down, you may want to look at mFloor(), mCeil(), and mAbs() as well.