Too many decimal places. How to deal with them?

Hi
How do people usually handle the decimal place. I’ve been using math.Round until I found out some problems. For example I pull out the elevation from Revit level, round it up to 3 decimal places and start a line on that elevation, the line is a little off from the Revit level. and some time also cause problem when doing grouping too. (16.66666669 and 16.66666666 will not in the same group because is far more precise that I need). Thanks

If you go to Settings > Number Format you should be able to control the precision.

My Number Format is set to 0.000, but has no effect.

1 Like

why are the number out so much to begin with - Has it been converted from Rhino or imperial units?

You could use the floor/ceiling command. But it depends on how much tolerance you need.

I’m also interested in this, number format seems has no effect and i need dynamo to create less decimals

@glenncai since you are dealing with Revit levels, and its their (unrealistic) elevations that are causing the problem, I would solve the problem rather than the symptom, namely, round the floor elevations to the nearest cm (10mm tolerance is acceptable for a building) then place your lines.

@cleo.beca the Geometry precision is a bit of basket case from what I can fathom. It appears to round internally, but not display this rounding in the UI, and that brings its own set of issues as I recently reported on the Dynamo GitHub:

https://github.com/DynamoDS/Dynamo/issues/8088

1 Like