Thursday 5 January 2017

arcmap - Specifying precision and scale of new field using ArcPy?


I'm wanting to create a field with a maximum of 1 decimal place and then calculate a value into it: (I know that all my values are < 10)


arcpy.AddField_management('C:/shapefile.shp', 'myField', "FLOAT", 2, 1, "", "", "", "NON_REQUIRED", "")
arcpy.CalculateField_management('C:/shapefile.shp', 'myField', "[MEAN]", "VB", "")

It seems that no matter what I try I can't get the number of decimal places I want - I get the full value from the field I'm calculating from : [0.888889] and when I view the field properties I just see 0 for precision and 0 for scale. The data context is ESRI shapefile. And altering the numeric settings in the field properties is not an option.


enter image description here


Anyone have any ideas?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...