Hatch Text Expression Question

549
2
Jump to solution
05-13-2014 03:39 PM
IvySchultz1
New Contributor
I'm trying to label mileposts every tenth of a mile on a highway which starts at milepost 35. While I've figure out how to make hatching every tenth of a mile and add 35 to each hatch, the hatching is off by 0.00000000000001 a few miles in and the label shows that many digits the rest of the way. While there is an easy way to make the precision value 0.0 in the drop down menu, this is grayed out if I build a hatch text expression so I need to incorporate rounding into my hatch text expression and I have no idea how to do that. My measured polyline is one record with a length field but I was using esri_measure + 35 to get the values. How do I add 35 to the hatching value and round it to the nearest tenth? I'm new to measured polylines in case you couldn't tell. Thanks for your help!
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
LT
by
Occasional Contributor
Have you tried using the Python round function?

>>> x = 35.00000000000001 >>> y = round(x,1) >>> y 35.0 >>> 

View solution in original post

0 Kudos
2 Replies
LT
by
Occasional Contributor
Have you tried using the Python round function?

>>> x = 35.00000000000001 >>> y = round(x,1) >>> y 35.0 >>> 
0 Kudos
IvySchultz1
New Contributor
Have you tried using the Python round function?

>>> x = 35.00000000000001
>>> y = round(x,1)
>>> y
35.0
>>> 


Thank you for your help! I found another expression that worked before I saw your post:

round((esri__measure+35),2)

It's good to have a reference of how it would look in python too.
0 Kudos