How can I evaluate and expresion to the nearest tenth?
Your Name
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Never did this but the list of available functions says to wrap your math in this, ROUND(x).
http://docs.autodesk.com/CIV3D/2012/ENU/filesCUG/GUID-448A4BEC-C1D1-404F-83B5-0C0E3B46ABB-2156.htm
John Mayo
The rounding functions are listed along with the rest of the math functions in the expression dialog box.
http://screencast.com/t/eiwAQhfa
CEIL rounds up, FLOOR rounds down
Try:
ROUND(X/0.1) *0.1
Out of curiosity, why don't you just use the label properties to round it? I'm sure there are reasons but I just gotta know.
And Freds second post would be the way to do it.
I don't mean to sound flippant, but isn't an integer a whole number? I want to deal with the decimal portion.
Your Name
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Yes, I'm sure you do.
This goes back to the earlier thread where the user wanted to label low points in plan and I suggested doing it with alignment labels that use the profile geometry. I can get the low point and high point labeled, I added a third element; the driveway elevation for top and bottom of curb.
I have a road rehab job where I profiled the gutter at a min 0.30% up and down and across the driveway aprons.
I created 3 label components LowPoint, HighPoint, DriveWay:
Lowpoint text height says IF({Grade In}-{Grade Out}<0 ,0.008,0)... If the Algebraic difference is neg I should see LP {profile elevation} and the other two labels go to zero
Highpoint text height says IF({Grade In}-{Grade Out}>0,0.008,0)... If the algebraic difference is pos I should see HP {profile elevation} and the other two labels go to zero
Driveway text height says IF({Grade In}-{Grade Out}=0,0.008,0)..If the algebraic difference = 0 (on grade) I should see a multiline label
TC{profile elevation + [expression that adds 0.12 to profile elevation}
BC{profile elevation, and the other two labels go to zero
I'm not getting the driveway labels. They are coming in as LP{elev} and HP{elev}.
So my thought was when I inserted the PVI on grade even though it displays 0.30% the expression may be see 0.299999999902? I'm guessing.
Do you see a flaw in my logic(opened myself up for all kinds of comments there)? I know I could use surface label styles but that would mean I'd have to have a surface. I'm only replacing the C&G so I was not thinking corridor.
Your Name
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
I'm not exactly sure I follow but I think I do.
In one situation I had, I wanted the label to be green if the slope was greater than 2.0%. The problem I ran into was if the label was 1.99% the label would still display as 2.0% but wouldn't be green. So what I did was to change the expression. Instead of testing to see if the slope was 2% or greater, I tested to see if it was 1.95% or greate (which is the lower limit of numbers that round to 2%).
So when you say your "road needs to be 3.0% or greater" what you are really saying is you "road needs to be a number that rounds to 3.0% or greater".
Make sense?
Attached is a file with said label style in it. It's from a lab I taught at AU 2008.
I though I could hide labels similar to the method for cut and fill tics.
this might explain what I am trying to get. Sorry our system will not let me DL your dwg to examine. could you email it? jbouza<at>cameronengineering<dot><com>
Your Name
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.