PROBLEM

Label expression produces incorrect results for field calculation

Last Published: April 25, 2020

Description

When specifying a label expression that involves numeric fields, the resulting label is incorrect. The Verify option, however, indicates that the expression is correct.

Cause

The field formatting is not correctly maintained in the resulting label.

Solution or Workaround



Make sure you typecast the result in the label expression. For example, clng([field]) converts the value of the [field] to an integer of type long.

The following example divides two numeric fields and calculates the population per sq/km; the result is an integer value:

Code:
clng([POP_CNTRY] / [SQKM_CNTRY])

Article ID:000003111

Software:
  • ArcMap 8 x

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic