摘要
When adding raw data containing numbers to ArcGIS Pro, significant figures are preserved to ensure precision when performing data analysis. To present the result, the numbers must be rounded off to a given number of decimal places. This article describes the workflows to round off numbers in an attribute table and label in ArcGIS Pro.
过程
Round off numbers in the attribute table
- Open the ArcGIS Pro project.
- Open the attribute table.
- In the attribute table, right-click the numeric field, and click Fields.
- In the Fields view, the numeric field is highlighted. In the Number Format column, double-click Numeric, and click the option icon. The Number Format window opens.
- In the Number Format window, select Decimal places for Rounding, and click the Increment or Decrement arrow to set the number of decimal places. In this example, the number is 2. Click OK.
- On the top ribbon, on the Fields tab, and click the Save icon.
Note:
The saved changes in the attribute table are not reflected in the label. The numbers in a label must be rounded off in the Label Class settings for the changes to be reflected on the map.
Round off numbers in the feature layer label
- On the Contents pane, select the feature layer.
- On the top ribbon, under Feature Layer, click the Labeling tab, and click the Enable Labeling icon.
- In the Label Class group, click the Expression icon in the Field section. The Label Class - <layer_name> pane opens.
- In Label Class - <layer_name> pane, ensure Arcade is selected for Language.
- In the Expression text box, delete the existing value.
- Under Functions, double-click Round().
- Under Fields, double-click the numeric field. In this example, the field is LENGTH. Ensure the field value is inserted in the Round() function.
- In the Expression box, next to the field value in the Round() function, type a comma (,) and the number of decimal places. In this example, the number of decimal places is 2.
Round($feature.<field_name>,<decimal_places_number>)
- Click the Verify icon to validate the expression.
- Click Apply.
The image below shows the numbers in the attribute table and label rounded off to two decimal places.