Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a featureclass (in a File Geodatabase), with a particular field of type Double. I want to copy it over to a text field, so that only 3 decimal places are shown.

For example: 34.78902345 becomes 34.789

I have gone through this question: How to convert a double field to a string?, but that does not solve my issue. I have even tried to format the double field, but even then the text field contains all the decimals.

How do I do this in ArcGIS 10.0?

share|improve this question
up vote 4 down vote accepted

You should be able to use string formatting:



>>> '{0:.3f}'.format(34.78902345)

Here is the Python string formatting cookbook for reference.

To use this in the field calculator you can create a function:

def my_format(val):
  return '{0:.3f}'.format(val)
share|improve this answer

You can use this python function within Field Calculator:

def updateValue(value):
  if value <> '':
    newValue = str(value)
    splitBefore = newValue.split('.')[0]
    splitAfter = newValue.split('.')[1]
    return splitBefore + '.' + splitAfter[:3]
  else: return ''

Name =

updateValue( !yourFieldName!)
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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