Original LIDAR ground elevation measurements go to about the 20th decimal, but I only need the labels rounded to one decimal point.
Using the following label expression, it rounded about 25% of the 2-million labels, but the remaining are still showing all 20 or so decimal places. (see attached image)
$feature.NGVD; round(number([$feature.NGVD]), 1)
The field name is "NGVD."
I'm purplexed as to why it appropirately rounds some but not all the labels. They're all in the same data field.
Solved! Go to Solution.
Using VBScript in the Label Class Expression, I used the following snippet:
Round ([NGVD], 1)
and my output label then drew something like 132899.5 for example.
Hope this helps!
Excellent - glad it worked out! Ha - yes, I was in the arcade as an early teen a lot of well playing Space Invaders and Asteroids. This "arcade" is "fun" I guess in other ways programmatically. If you're so inclined, please mark my answer as "Answered" so it closes this thread. Thx!
Using VBScript in the Label Class Expression, I used the following snippet:
Round ([NGVD], 1)
and my output label then drew something like 132899.5 for example.
Hope this helps!
Ahh... following up on your suggestion, I discovered - being new to Pro, that I wasn't in Python at all. I was actually in some language called Arcade - which is ironic, given that as a kid you couldn't get me out of an arcade.
Once I discovered the "Language" drop-down list and switched to VBScript, using your code, then all was than right with the world... or at least it's elevations anyway.
Thanks.
Scott
Excellent - glad it worked out! Ha - yes, I was in the arcade as an early teen a lot of well playing Space Invaders and Asteroids. This "arcade" is "fun" I guess in other ways programmatically. If you're so inclined, please mark my answer as "Answered" so it closes this thread. Thx!
How can we limit the decimal points when it comes to interpolation surfaces ? There is no Label tab or a Label expression option
This works, but it's kinda silly that we have to add this expression when you can limit the decimal places in the Table Fields. Or that it's not just a formatting option in the Label Class window.
A downside of this method is the number of decimals is not padded, ie 29.03 is displayed as "29" not "29.0". There is fortunately, another function (which also adds commas by default for large numbers):
FormatNumber([NGVD],1)
Or, using Python (note in Python you must float() the value, as the label parser gets the value as string, regardless of field type! -- VBScript of course, being VBScript, doesn't care about data type)
"{:0.1f}".format(float([NGVD]))
How can we limit the decimal points when it comes to interpolation surfaces ? There is no Label tab or a Label expression option.