Round a number?
by Daniel Brown · in Torque Game Engine · 08/13/2005 (4:36 am) · 2 replies
Hey all,
How do I round a number to the nearest whole number in script? I can't find a function for it!!
Thanks
How do I round a number to the nearest whole number in script? I can't find a function for it!!
Thanks
About the author
#2
08/13/2005 (9:34 am)
As Michael has pointed out you can use floor and ceil to round down or up. You can also round off using%newval = mFloor(%val+0.5);
Torque 3D Owner Michael Day
mFloor() and mCeil(), depending on whether you wish to round down or up respectively. For other maths functions in script, look in mConsoleFunctions.cc