PDA

View Full Version : rounding numbers


ARTillery
06-08-2011, 01:01 AM
hello,

Is there a way to round numbers like if the number is 3.3 result should be 3 but if it's 3.7 the result should be 4.

the help mentions floor and ceil which isn't what I want, I want a mix of them. :)
sorry if it's a newbie question but I don't use maxscript that much.

denisT
06-08-2011, 01:08 AM
hello,

Is there a way to round numbers like if the number is 3.3 result should be 3 but if it's 3.7 the result should be 4.

the help mentions floor and ceil which isn't what I want, I want a mix of them. :)
sorry if it's a newbie question but I don't use maxscript that much.
http://forums.cgsociety.org/showpost.php?p=6184517&postcount=4

ARTillery
06-08-2011, 01:19 AM
so there isn't actually a predefined method to do this.

thanks for the function.

denisT
06-08-2011, 01:33 AM
so there isn't actually a predefined method to do this.

thanks for the function.
there are several...
float as integer
floor (<float> + 0.5)
...

but this one is the right one

CGTalk Moderation
06-08-2011, 01:33 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.