Select to view content in your preferred language

Arcade Label Expressions omitting field settings

1189
2
Jump to solution
12-09-2020 05:54 AM
by Anonymous User
Not applicable

Hi there. I am using Arcade to create custom labels for multiple vector layers including name fields and value fields. Typically, I format the value fields in the attribute table to display percentages rounded to 1 decimal and padded with zeros. When I use Arcade to format label expressions, however, it is omitting these settings from the fields. I can manually round and format (as seen below), but I am not sure how to manually pad with zeros within my label expression. I need the whole numbers like 25% to show up as 25.0%.

"""
"<BOL>" + $feature['Regions_base.Name'] + "</BOL>" + TextFormatting.NewLine + Text(Round($feature['Regions_Employment$.change_Feb_Aug'] * 100, 1), "##.#")+ "%"

Thanks to anyone who has any ideas! 

 

 

0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

In the Text function, use "0" intead of "#" when you need to maintain either leading or trailing zeros.

Text(Round($feature['Regions_Employment$.change_Feb_Aug'] * 100, 1), "##.0")+ "%"

View solution in original post

2 Replies
KenBuja
MVP Esteemed Contributor

In the Text function, use "0" intead of "#" when you need to maintain either leading or trailing zeros.

Text(Round($feature['Regions_Employment$.change_Feb_Aug'] * 100, 1), "##.0")+ "%"
by Anonymous User
Not applicable

Amazing! Thanks so much! 

0 Kudos