HOW TO

Retain trailing zeroes after the decimal point in pop-ups for ArcGIS Online Map Viewer

Last Published: September 30, 2022

Summary

It is sometimes required to have the field value display trailing zeroes after the decimal point to show consistency in the ArcGIS Online Map Viewer pop-ups. The image below shows the attribute table with two decimal numeric values, but the pop-up does not retain trailing zeroes after the decimal point.

The attribute table and the pop-up in ArcGIS Online Map Viewer

This article provides an example and two workflows to configure the number format for pop-ups to retain trailing zeroes after the decimal point in the pop-up for ArcGIS Online Map Viewer using the Configure fields tool, and Arcade expressions.

Procedure

Use the Configure fields tool in Map Viewer

In Map Viewer, use the Configure fields tool to configure the number format of the field value in the pop-up. Refer to ArcGIS Online: Configure fields to do so.

Use the custom Arcade expression to configure pop-ups in Map Viewer

  1. Click Layers on the Contents (dark) toolbar, and select the layer with the pop-up for editing. In this example, the RC Maximum Floor Area Ratio layer is selected.
The Map Viewer Contents (dark) toolbar with the Layers tab
  1. Click Configure pop-ups on the Settings (light) toolbar, and click Options > Attribute expressions.
The Map Viewer Settings (light) toolbar and the Pop-ups pane
  1. Click + Add expression to open the Arcade expression editor window.
  2. In the editor window, specify a name for the new expression as required.
  3. In the Expression dialog box, insert the following Arcade expression. The example of the expression below is to display a two decimal point number format. Remove or add zeroes to decrease or increase the number of decimal points as required.
Text($feature.<fieldName>, '#,###.00')
  1. Click Test to view a preview of the expression result. If the required result is achieved, click OK.
Specifying the Arcade expression in the Portal for ArcGIS Map Viewer editor window
  1. Click the Previous button above the newly created Arcade expression in the Attribute expressions pane.
The Map Viewer Pop-up expressions pane with the Previous icon above the newly created expression
  1. Click Fields list to expand the list of fields displayed in the pop-ups, and click Select fields.
  2. Check the expression field under the Expressions section, and click Done.

The image below shows the newly added Floor Ratio (2 decimal) field in the pop-up using ArcGIS Arcade expression.

The end result of the pop-up display in ArcGIS Online Map Viewer

Article ID: 000028267

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