# Xpresso: Rounding to whole numbers?

 12 December 2006 Newstream Expert   portfolio A N 3D-Illustrator, Animator Newstream Stockholm, Sweden Xpresso: Rounding to whole numbers? Hi Gang, Sorry for the embarrassingly n00bish question but I've got a brick missing in my humble wall of Xpresso knowledge. Question: Is there a node (or simple way) to round off numbers? For example: Lets say a node is outputting a value of 878.882 and I want the number to be rounded off to its closest whole number, in this case: 879 Any tips appreciated. Cheers / Alex __________________ ----------| C4D R17 Studio | Rhino 5 | Zbrush 4 |---------- share quote
 12 December 2006 Per-Anders helper bunny   portfolio Forum Leader Per-Anders Edwards Developer The Third Party USA just plugging your "real" output into an "integer" input (or long) will result in the value being automatically rounded down, you can use the universal converter node to do this if you want to. you can also use the math->FloatFunc node and pick "Floor" to round down to "Ceil" to round up (the result will still be a real "floating point" number rather than an integer). __________________ The Third Party | Homepage | My Reel "You need to know what you're doing before you start, and to start because you need what you're doing." share quote
 12 December 2006 Newstream Expert   portfolio A N 3D-Illustrator, Animator Newstream Stockholm, Sweden Originally Posted by Per-Anders: just plugging your "real" output into an "integer" input (or long) will result in the value being automatically rounded down, you can use the universal converter node to do this if you want to. you can also use the math->FloatFunc node and pick "Floor" to round down to "Ceil" to round up (the result will still be a real "floating point" number rather than an integer). Thanks for those useful tips Per! The math->FloatFunc node worked the best for this particular scene. Good to learn something new too Cheers / Alex __________________ ----------| C4D R17 Studio | Rhino 5 | Zbrush 4 |---------- share quote
 12 December 2006 CGTalk Moderation Expert Thread automatically closed 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. __________________ CGTalk Policy/Legalities Note that as CGTalk Members, you agree to the terms and conditions of using this website. share quote

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts vB code is On Smilies are On [IMG] code is On HTML code is Off CGSociety Society of Digital Artists www.cgsociety.org Powered by vBulletinCopyright ©2000 - 2006, Jelsoft Enterprises Ltd.