操作方法

操作方法:在 ArcGIS Pro 中为标注添加千位分隔符

Last Published: September 11, 2023

摘要

In ArcGIS Pro, when labeling numeric features with the option to Show thousands separators activated on the data, the separators do not automatically appear in labels.

原因

In ArcGIS Pro, the default language for label expressions is Arcade and when using Arcade, field formatting on the layer is not applied to the labels. Arcade formatting methods are required. 

过程

There are two methods to add thousands separators to labels in ArcGIS Pro:

  • Use an Arcade Text function to format the numbers in the label expression.

    In the World Cities data below, we see that the POPULATION field contains data about each city’s population. When labeled, there are no thousands separators by default.
User-added image
To address this, change the label expression to:
Text($feature.field_name, '#,###')
User-added image
Note:
The label now displays the thousands separators. See the Related Information section for more information on Arcade functions.
  • Alternatively, enable Show thousands separators in the attribute table by changing the Number Format from the Fields View. After changing the number format, switch the labeling language from Arcade to one of the other options such as Python, JScript, or VBScript.

Either of these methods can be used in ArcGIS Pro. However, the advantage of using Arcade is that if publishing your layers to the web, the expression is honored and the thousands separators are maintained in your web map and app labels. This is not the case when using one of the other labeling languages. 

文章 ID:000016672

从 ArcGIS 专家处获得帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项

相关信息

发现关于本主题的更多内容