Rounding Values


#1

When i connect List.GetItemAtIndex to StringFromObject my values changes to 6 decimal places. How do i change StringFromObject Values to zero decimal places?

 

Untitled


Numbers with Decimals
#2

Since you are getting a string from the number you can use String.RemoveAfterGivenCharacter from Rhythm.

2015-05-14_13h02_46

 


#3

Thanks John, your the champ!!!


#4

I have a similar problem, but I want to keep two decimals after the decimal delimiter. How can that be solved?

Sorry found a recent thread with an allroud solution (Python object to string).


Wall Structure Material
#5

I am probably overthinking a bit here. But see below for a solution. I can publish this to Rhythm as well.

2015-07-27_15h18_52

 

2015-07-27_15h25_14


Remove trailing zeros
#6

Thanks, I’ll test it, the python code didn’t work because the input from built in Point.[X] nodes is a float internally and it gives a ton of trailing numbers.


#7

See my last response and get the Rhythm package in the package manager. I tend to avoid python scripting and stick primarily to OOTB nodes.


#8

Thanks, I redid your screenshot and it worked and I’ll get latest version of your package also. :slight_smile:


#9

In my version I added a possibility to specify number of decimals and the separator (because I am living in an ISO country but my output requires a dot as separator).


#10

John doesn’t say how you got the parameter String.RemoveAfterGivenCharacter)? I also have problems with rounding wanna try your method.


#11

John already mention above.You need to install rhythm package. You can search rhythm package in dynamo or download from dynamopackages.com.

Good Luck!