AnsweredAssumed Answered

How can I use Python to separate thousands with commas in an attribute table

Question asked by JamieTratalos on Jan 10, 2018
Latest reply on Jan 10, 2018 by Dan_Patterson

I want to format a large number of fields in an attribute table so that  they display with thousands separated by commas.


Is there any way to do this using python?


To do it via the GUI you would 1. display the attribute table, 2. right click on each field name, 3. select 'properties', 4. click on the '...' icon next to 'numeric', on 'show thousands separators' 6. select 'OK', 7. select 'OK' again.


I want to automate it so that the Python script would do this for all fields with an index number > 5 - that is, ignoring the first few fields which contain non-numeric data.


The reason I want to do this is that I want the field values to be displayed with thousands separators when they are displayed as labels in a map.