I am trying to round down the values of my outputs so that it is always a whole number if the division yields decimal points.
Example -
16.6667 = 16
15 = 15
14.25 = 14
18.9 = 18
I thought Math.Floor is the right node for this, but when I used it for a division that yielded a whole number (15, in this case), the Output from Math.floor gives 14…
My guess is that the Math.Floor function is a result of the rounding of the previous value to 15 from 14.9999999999. Try multiplying by 1 first and see if that adjust the values.
Hi kennyb6, I tried to do that but I still get 14.
At the moment, I just used Math.Round for this particular incident while the others are using Math.Floor.
I am attaching both the Revit file with the families I’m using & Dynamo file if you want to take a look. All orange groups are for inputs, and I added a grouped Code block in Pink color. That’s where the issue is.
So the number isn’t exactly 6. Technically there is a 8.8 to the -16th power attached to that 6. So the next question is how many decimal places do you want the widths to be? You can *10, round, divide by 10 to get 5.4, 6.0, etc. and floor will work then.
This is the first time I have seen it happen, but it happens regardless of what whole number I change the family’s parameter to. If I had to guess, it could be because your family’s units are mm but the project is in meters. Since Revit’s default units are feet/inches, there is probably some conversion error from the family’s mm being changed to inches, then being changed to meters inside the project.
I am not actually sure if this is how Revit handles unit conversions between families and projects but it is just an assumption.