Activity › Forums › Maxon Cinema 4D › Xpresso Question -Displaying 4 Decimal Places
-
Xpresso Question -Displaying 4 Decimal Places
Posted by Tony Barone on February 15, 2016 at 5:38 pmI’m trying to put together a setup in XPresso to create a text output with a string of numbers controlled by a float slider. Seems easy enough, except I need the numbers to extend 4 decimal places. Its for a readout display to indicate degree angle, so the display should go from 0.0000º to 360.0000º.
In the User Data, I can only set the step size to 3 decimal places and I need to go to 4.
Can anyone help me out with this?
Kouraib Abdmalekreplied 2 years, 6 months ago 2 Members · 8 Replies
-
8 Replies
-
Tony Barone
February 15, 2016 at 9:43 pmFound an answer to my question:
There is a System Preset node called Set Decimals, in the String session.
Just feed it with the number in the Value port and the number of decimal places in the Following port.
The result is a String with the decimal places clamped.
If you set the number of decimal places to 0, it will round to the nearest integer. -
Kouraib Abdmalek
January 10, 2024 at 8:42 pmHi Tony,
Even if the decimal place does not change in the fields, The actual floating point will change, because Cinema 4D only rounds the decimal place for the display of the numbers in the fields, but stores the actual floating point decimal value, so if you zoom on to an object and add a value in the fourth decimal place to its position. You’ll see it move in the viewport.
I hope this helps you.
-
Tony Barone
January 10, 2024 at 9:53 pmMy problem is, I would like to make a number counter to simulate a display. I need the display, for example to show the numbers change from 0.25 to 50.00
I would like the numbers to the right of the decimal to incrementally change as it goes from one to the other.
-
Tony Barone
January 10, 2024 at 9:58 pmHere is a file that shows you my current solution along with my attempt below it using the Set Decimal node.
-
Kouraib Abdmalek
January 11, 2024 at 11:18 amYou can do it by using numbers that rotate in cylinders, as in an odometer. The only problem is that you need the Coffee Effector, which is no longer supported in the latest version, I think after R19. But you can get it as a plug-in from the Internet and then install it on the newer versions. I have attached the file and a video showing how it works.
I hope this helps you
-
Tony Barone
January 23, 2024 at 4:54 pmThanks again for your help… My solution was to fake it, as in one of the project files I sent.
I didn’t realize, until rendering, I had to use the “Set Decimals” node in XPresso since C4D calculates to the 3’rd decimal place when rendering. Because I need the animated display to show 000.00, I set my starting number at 100000, separate the last 2 digits a bit with kerning, put in an object for the decimal and hide the “1” with a Boole object so my animated display appears to start at 000.00
-
Kouraib Abdmalek
January 24, 2024 at 10:22 amYou are welcome! thanks for sharing your findings with us, the file that I sent also work vey good just you have to play it with R19 version or to get the Coffee plugin from the internet.
Reply to this Discussion! Login or Sign Up