Problem: Unable to insert numbers into a field in an attribute table of a feature class
In ArcMap, attempting to insert numbers into an attribute table is not allowed. Instead, a generic error such as the following is returned,"This number field can only have 2 digits to the left of the point."
This occurs due to the difference between the precision and scale of either a float or double type field with the input value.
Precision and scale of a field describe the precision and the maximum size of data which can be stored in a field. The precision describes the number of digits which can be stored in a field while scale describes the number of decimal places for double and float fields.
During the creation of an attribute table, the precision and scale of the table can be set to provide greater control. For example, if a field was created with the float data type with a precision of 4 and a scale of 2, the value 54.32 is accepted. However, an error message is displayed when a value of 54.321 is inserted in the field.
Solution or Workaround
Create a new field in the feature class table using the Add Field geoprocessing tool, and specify the precision and scale of the new field.
1. Open ArcMap and navigate to ArcCatalog > Toolboxes > System Toolboxes > Data Management Tools > Fields > Add Field.
2. Fill in the parameters of the new field, specify the precision and scale of the field, and click OK.
For further explanation on the precision and scale of the fields, refer to the following ArcGIS Help document, ArcGIS field data types.
Calculate values from the old field to the new field using the Field Calculator.
1. Right-click the new field > Field Calculator.
2. In the Field Calculator, type the script as highlighted below, and click OK.
- ArcGIS Help: DB2 data types supported in ArcGIS
- ArcGIS Help: Informix data types supported in ArcGIS
- ArcGIS Help: PostgreSQL data types supported in ArcGIS
- FAQ: Should I be concerned about precision and scale settings when creating a new field in my attribute table?
- Problem: A field value is rounded to the nearest tenth after geocoding