1

Is it possible to change the precision of a field in the attribute table in ArcMap?

I have a shapefile with X and y coordinates of pointlocations. I would like to change the precision. Is this possible?

Gerben
  • 119
  • 1
  • 4
  • 1
    Are you wanting to change the precision for the stored value or just a visual representation of the field within the attribute table? Also, what version of ArcGIS are you using? – artwork21 Feb 11 '16 at 13:55
  • 1
    Note though, that you won't get any more precision than is in your original data. If your data is accurate to three decimal places, changing it to six won't give you any improvement. – recurvata Feb 11 '16 at 15:04

1 Answers1

2

Before ArcGIS 10.2 you could not rename a field using the Alter Field-tool. With 10.2. upwards is much easier to get this to work. You have to add a new field with the desired precision to your shapefile and copy all the values from the one column to the next one using fieldcalculator. Then you can delete the original column and rename the new one to the original ones name.

Alternativly you can write a script:

arcpy.AddField_management(myTable, "NewName", "DOUBLE", decNumbers)
for row in arcpy.SearchCursor(myTable):
    row.setValue("NewName", row.getValue("OldName"))
arcpy.DeleteField_management(myTable, "OldName")
arcpy.AlterField_management(myTable, "NewName", "OldName")
MakePeaceGreatAgain
  • 1,491
  • 1
  • 10
  • 26