Floating point Value precision

Hi All,

I tried to convert a text “12” to number. By doing so I got something like 12.0000.

Is there a node to control float value precision.

Thanks in advance

Hello Arun,

You can achieve this very simply with one line of Python! Here we cast the string object to an int by calling the int() function. Note that ints are integers (Whole numbers).

OUT = int(IN[0])

If you wish to convert to a decimal placed number instead, use the following line:

OUT = float(IN[0])

1 Like

You can also do this in DesignScript by casting ToNumber and if the out-of-the-box node still gives you rounding errors, then use the Math.Round() function.

4 Likes