HOW TO

Label decimal values as percentages using Arcade expression in ArcGIS Online

Last Published: December 14, 2022

Summary

In some instances, an attribute value in percentage is written in decimal values when displayed in labels on web maps in ArcGIS Online. In this article, an Arcade expression is used to convert the decimal values to percentages and display the percentages in labels. In this example, the field used to display the percentages as decimal values is 'Ratio’.

The image below displays labels with decimal values in ArcGIS Online.

Web maps displaying decimal values as labels.

Procedure

  1. Open the web map in ArcGIS Online Map Viewer.
  2. On the Settings (light) toolbar, click Labels Labels icon..
Note:
Ensure labels are enabled, refer to ArcGIS Online: Apply labels for instructions.
  1. In the Label features pane, under Label field, click Use expression Use expression icon..
  2. In the editor window, type the following expression and replace <field_name> with the name of the field to be displayed as labels. This is a conditional statement that does not label any feature that has a value of 0.00. It labels other features by multiplying the value by 100 and adding a percent sign.
IIf($feature.<field_name> == 0.00, null, ($feature.<field_name> * 100) + "%")
Note:
For multiline labels, specify the expression as follows.
'<field_name>:' + $feature.<field_name> + TextFormatting.NewLine + '<field_name>:' + $feature.<field_name> + TextFormatting.NewLine + '<field_name>:'+ IIf($feature.<field_name> == 0.00, null, ($feature.<field_name> * 100) + "%")
  1. Click Done in the bottom right corner of the window.
Arcade expression specified in the expression editor window.

The image below displays the percentage labels on the web map in ArcGIS Online.

The percentage labels on the web map

Article ID: 000028911

Software:
  • ArcGIS Online

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options