Select to view content in your preferred language

Programmatically format standalone table fields in ArcMap

459
3
05-13-2020 04:45 AM
BrentStinson
New Contributor

I've added a standalone table from Excel which has 80 numeric fields. I'd like to find a way to programmatically change the scale of the fields so that the contents display with 0 decimals instead of the default 6 decimals.

0 Kudos
3 Replies
DavidPike
MVP Frequent Contributor

Can this not be done in excel first? Otherwise I would run an arcpy.da.UpdateCursor to truncate or round the figures.

Field type LONG could also be used with Alter Field—Data Management toolbox | Documentation 

0 Kudos
JoeBorgione
MVP Emeritus

I've added a standalone table from Excel...

Have you performed an Excel to Table and created an actual geodatabase tabke or simply added an Excel worksheet to your ArcMap session?

That should just about do it....
0 Kudos
BrentStinson
New Contributor

I ended up using the Round function in Excel to round all of my values to 0 decimals, saved the worksheet as a .csv, and then added that as a table in ArcMap. The resulting data fields are Numeric with 0 decimals. Thanks to all who responded!

0 Kudos