August 31, 2005

Rounding Up Property Data Values

I have found that the "up" and "down" rounding options in Property Data Formats in Autodesk Architectural Desktop 2006 are not working properly. There are situations, such as calculating occupant loads, where you want to round any fractional amount up to the next whole number. The "up" option should do that, but does not.

In my August 30, 2005 post to the "area schedules divided by code area" thread in the Autodesk Architectural Desktop 2006 Discussion Group, I posted a sample file that contains a formula property that forces a round up to the next whole number value. The formula determines the whole number portion of the number to be rounded by using the VBScript Fix function to truncate any fractional part. The whole number is then subtracted from the original number to determine the fractional part. If the fractional part is greater than zero, the RESULT is the whole number plus one; otherwise the RESULT is the whole number.

Note that this assumes that the original number is not a negative value; if the original number is a negative value, you will need to determine which way you want the negative number to go [toward or away from zero] and you would want apply the VBScript Abs function to the fractional value when checking if it is greater than zero.

No comments: