Unwanted decimals showing in Revit label

Hi! I am having an issue with unwanted decimals showing after I update a value in a Label element with a dynamo script. The Entire script is getting parameter values from Doors in a Project and Applying them to a custom Legend family that includes Labels.

When adding the value from the Door to the label (with Element.SetParameterByName node) it automatically adds 6 zero’s to the number. For example: 3 becomes 3.000000 as shown in the screenshot.

I have already tested a lot to see if it could be related to project settings or the Label family. But whatever I do it still adds the 0’s. Any help with this would be very much appreciated.

This happens when you convert a double to a string. You can avoid the trailing zeros by first converting the double to an integer and then a string. You can do this easily by just using Math.Floor.

3 Likes

Ah okay! thankyou so much, it worked straight away :smile: