HOW TO

Convert decimal feet into feet and inches using the field calculator in ArcGIS Pro

Last Published: March 2, 2023

Summary

In ArcGIS Pro, the Calculate Field tool can be used to convert values in decimal feet into feet and inches and populate the values into a new text field. A clearer representation of the units can be useful for labeling purposes. The workflow in this article describes how to achieve this by creating a function containing the conversion formula and splitting decimal feet into two different units.

Procedure

  1. Create a new text field to populate the output in the feature layer in ArcGIS Pro.
    1. In the Contents pane, right-click the feature layer and click Attribute Table. The example used in this workflow is the poi layer.
    2. Add a new text field to the attribute table. Refer to ArcGIS Pro: Create and manage fields for instructions to do so. The new text field in this workflow is named Label.

The image below shows the poi attribute table with the new text field.

The attribute table with a Text data type field
  1. Convert the decimal feet values into feet and inches using the Calculate Field tool.
    1. On the top ribbon, click Analysis > Tools.
    2. In the Geoprocessing pane, search for the Calculate Field tool.
    3. Under Parameters, select the layer for Input Table.
    4. Select the field created in Step 1 for Field Name (Existing or New).
    5. Select Python 3. For Expression Type.
    6. In the Expression text box above the Code Block box, enter the following script:
convert(!<field name>!)
The Calculate Field pane to be configured
  1. In the Code Block box, enter the following script:.
def convert (number):
    feet = int(number)
    inches = (abs(number)-feet)*12
    result = str(feet)+"'" + str(int(round(inches, 0))) + "''"
    return result
The Code Block in the Calculate Field pane with the Python script
  1. Validate the expression and click Run.

The image below shows the values in the new units populated in the Label column.

The Label text field populated with the values in the new units

Article ID: 000025560

Software:
  • ArcGIS Pro 3 1
  • ArcGIS Pro 3 0
  • ArcGIS Pro 2 x

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