I'm writing a ModelBuilder to run many shapefiles output to database that has the sum acres for each crop however by looking at the field column it does not show comma like for example

Alfalfa 351178.314628 what I would like to make the number 351178.314628 into 351,178 ?

I can export it to python and add if there is code; however I am not python expert.

I'll have this screenshot sample:

Summary ModelBuilder

enter image description here

  • I updated my answer below, since based on your other questions you definitely the comma automatically inserted. I hope it's more helpful now.
    – Erica
    Jul 17, 2014 at 12:43

3 Answers 3


Two approaches are possible, depending on what your goal is.

Display Purposes Only, Don't Want Extra Field

This isn't a function in ModelBuilder, but rather a question of how the number is being displayed in the attribute table. Here's how to change that (based on these instructions):

  1. Right-click on the field heading (SUM_Acres_) and choose "Properties"
  2. Click the ... button next to "Numeric"
  3. In the next window, check the "Show thousands separators" box.

(You can also reduce the number of decimal places it shows in the same dialog.)

The Data Needs That Comma, An Additional Field Is Fine

If you want this to be all contained within one ModelBuilder operation and/or done automatically for you, the table will need to have a new field. (This can simplify subsequent sharing, labeling, etc. since the previous method will only affect the attribute column display, not the underlying data.)

Two additional operations are required in the model for this:

additional ModelBuilder steps

  1. Add Field: Add a new field. Make sure that the new field type is TEXT.

    add field inputs

  2. Calculate Field: Use the expression format(int(!SUM_Acres_!), ",") in the field calculator: this will both remove trailing decimals, and include commas as thousands separators.

    ModelBuilder can be quirky about the fields it lists after an Add Field operation, so you might need to type in the name of the new field. Make sure that Expression Type is set to PYTHON not VB.

    calculate field inputs

  • Glad it worked. Sorry I didn't fully understand what you were hoping to get the first time I answered :)
    – Erica
    Jul 17, 2014 at 16:28
  • Sorry I tried my best. I'll show the the picture in a minute...I added what you suggest and then I tried and it works nicely !
    Jul 17, 2014 at 16:31

Alternatively, you can create a string field and calculate the following into it using python:

  • @gtein_appgeo How or where should I insert this in Python ?
    Jul 15, 2014 at 20:34

I've made some modified and an additional tools to make this Model Builder a final one. I ran this on test and this works very nicely !! I would like to thank Erica for her help to make this possible My Model Builder

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.