Round to Variable Decimal Place?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  01 January 2014
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
 
  01 January 2014
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
 
  01 January 2014
The "set decimals" (String Nodes) does it
 
  01 January 2014
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
 
  01 January 2014
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
 
  01 January 2014
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
 
  01 January 2014
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
 
  01 January 2014
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.
 
Thread Closed share thread



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 vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 04:40 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.