# Round to Variable Decimal Place?

 01 January 2014 #1 mayajunky Addicted for life   portfolio Brian Metzger Advanced Product Engineer Douglas Machine Alexandria, USA   Join Date: Oct 2005 Posts: 844 Round to Variable Decimal Place? Hey all...so I'm doing some searching through old threads here now but... Anyone have an xpresso group setup for truncating the output ( to OSD ) of a float value to a defined decimal place? I'm looking to output float-values to a text object on-screen to both 1st and 2nd decimal place ( user defined ). Is sort of looking like I'm going to have to use a python node, but still curious of any standard xpresso node setups. One would almost think there would be a node for specifically handling this ( for the technical anima field! ). Also could be an instance I want to output a display value past the typical 3 decimal places you see C4D output in it's display. ( I know the physical math precision behind the scene can do double-floats ). Any thoughts/advice/setups would be greatly appreciated, thanks! __________________ www.mayajunky.com All my favorites ~ Cinema 4D R13, After Effects, Photoshop CS5, Lightroom, Photomatic share quote
 01 January 2014 #2 mayajunky Addicted for life   portfolio Brian Metzger Advanced Product Engineer Douglas Machine Alexandria, USA   Join Date: Oct 2005 Posts: 844 Well i ended up using a node stream which uses a multiplier ( either 1, 10 or 100 ), then floatFunc to floor, then divide by same constant ( 1, 10 or 100 ). Gives me the option to output 0, 1st & 2nd decimal place. Maybe someone has a more elegant solution though! __________________ www.mayajunky.com All my favorites ~ Cinema 4D R13, After Effects, Photoshop CS5, Lightroom, Photomatic share quote
 01 January 2014 #3 base80 Know-it-All   base80 Netherlands   Join Date: Feb 2004 Posts: 385 The "set decimals" (String Nodes) does it __________________ base80.com base80's Facebook page base80's Youtube channel share quote
 01 January 2014 #4 mayajunky Addicted for life   portfolio Brian Metzger Advanced Product Engineer Douglas Machine Alexandria, USA   Join Date: Oct 2005 Posts: 844 Your the man base80! Of course there would easily be an attribute/mode on the string node I didn't think to even look for! Was just getting output from math node as a combined string to port to text. Will check it out in the morning at work, thanks! __________________ www.mayajunky.com All my favorites ~ Cinema 4D R13, After Effects, Photoshop CS5, Lightroom, Photomatic share quote
 01 January 2014 #5 mayajunky Addicted for life   portfolio Brian Metzger Advanced Product Engineer Douglas Machine Alexandria, USA   Join Date: Oct 2005 Posts: 844 Oh and thanks for all the knowledge on your site too base80. __________________ www.mayajunky.com All my favorites ~ Cinema 4D R13, After Effects, Photoshop CS5, Lightroom, Photomatic share quote
 01 January 2014 #6 base80 Know-it-All   base80 Netherlands   Join Date: Feb 2004 Posts: 385 As for the second part of the question I can only suggest to multiply by 1000000000 to get the "internal" figure. Then again with the text nodes you can take the . (point) out and put it back at the right place. It is less work to make this than to explain it actually __________________ base80.com base80's Facebook page base80's Youtube channel share quote
 01 January 2014 #7 mayajunky Addicted for life   portfolio Brian Metzger Advanced Product Engineer Douglas Machine Alexandria, USA   Join Date: Oct 2005 Posts: 844 I always forget about those "system presets"... along with the entire String section.. ( shakes head in shame ). Would be nice if was some documentation on these nodes like the regular pool of xpresso nodes. Suppose one would say the documentation is the coffee script. Although as an animation generalist I don't get too heavy into scripting. Thanks again though is what I need, will have to investigate the other string nodes! __________________ www.mayajunky.com All my favorites ~ Cinema 4D R13, After Effects, Photoshop CS5, Lightroom, Photomatic share quote
 01 January 2014 #8 CGTalk Moderation Expert   Join Date: Sep 2003 Posts: 1,066,473 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.