- The Input node takes a number as input.
- The Math.Floor node takes the input number and truncates any fractional part.
- The x subtract y. node subtracts the result of the Math.Floor node from the original number, to determine the fractional value (if any).
- The x less y? node compares that fractional value to zero, generating a value of true if it is greater than zero, or false if not.
- The If node uses that true/false value as the test input, and passes along a value of 1 if the test value is true or 0 if the test value is false.
- Finally, the Adds x to y. node adds the truncated result of the Math.Floor node to the value of the If node, and passes this along to the Output node as the result of this custom node.
So, if there is a fractional amount, one is added to the whole number portion of the input value; otherwise, zero is added to the whole number portion, which is "rounding up".
While testing this as part of my Dynamo graph, I noticed that one of the Area values, which was reporting as 100 square feet in Revit (after using the RoundUp function in Revit) was unexpectedly rounding up to 101. I took a look at the node values and discovered that an Area that was inside boundaries that formed a 10'-0" square was reporting an area of 100.000000000002 square feet inside Dynamo. While I always want to round any true fractional value up, I decided that it was unreasonable to assign two occupants to that 100 square foot Office (at 100 square feet per occupant) for a non-zero value in the twelfth decimal place. In my mind, that is a computational error. So I came up with another custom node, called Round Up with Floor (see image below).