Select to view content in your preferred language

Remove Trailing Zeroes from Labels in ArcOnline

370
1
05-31-2024 11:10 PM
Labels (1)
JustinGeertsen
New Contributor

I am trying to create a road map, but the main roads have 7-digit ID's that I'm using as labels that have 5 to 4 trailing zeroes, such as the 1800000 road, or the 1917000 road. This obviously creates unnecessarily messy labels and I want to trim off any and all of these trailing zeroes using a label expression. I have absolutely no experience with coding so need help though. Thanks!

0 Kudos
1 Reply
KenBuja
MVP Esteemed Contributor

You can use this expression. First it checks if there are five trailing zeros, then it checks if there are four.

Replace(Replace($feature.ID, '00000', ''), '0000', '');

 

0 Kudos