Jump to content

Rounding to whole number in formula


y49sides

Recommended Posts

Good morning.

 

I have a small issue with adding two area calc's and rounding to a whole number.

 

Example.

Using the field command: (Field, Object, Polyline, Architectural, Precision 0.0)

 

Cell 1 - First Floor Area (polyline) = 526.5 sq. ft.

Cell 2 - Second Floor Area (polyline) = 482.8 sq. ft.

 

Cell 3 - I use the (SUM) command: =SUM(B3:B4) shows 1009 sq. ft.

 

When I remove the precision to "0" in the fields, they round to a whole number (this is good)

Unfortunately, the "SUM" field still looks at the actual sq. ft. (all decimals) of the two cells and will not update to 1010 sq.ft.

 

I've read that there is a ROUNDUP function but I'm not sure if this is the best solution and Plus I cant get it to work.

 

Any help would be very much appreciated!

Thank you in advance.

Link to comment
Share on other sites

You have to decide whether you need the number to be rounded, i.e. half the numbers would be rounded down and half the numbers would be rounded up, or whether you would like the number to be always rounded up.

 

Then you have to find out the inbuilt expressions so that you can use them.

 

For example there is a function "round", which would do the rounding. But if you wanted to always round up, then you should use the expression "trunc" and add 1.

 

Never rely on the precision to give you integers. The full autocad precision is always there, but hidden.

Link to comment
Share on other sites

Eldon,

Thank you for the reply.

I am looking for the first 2 cells to round to the nearest whole number. I the example above, both would round up. But I have many cases that it should round down.

 

Any idea how the formula in cell 3 should read?

thanks.

Link to comment
Share on other sites

I just know the theory but I do not use an AutoCAD version with fields.

 

But if I were to do it in Excel, then the formula could read =SUM((ROUND(B3,0)),(ROUND(B4,0)))

 

Someone else may know if a more efficient way is possible.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...