Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

How can I round the decimal number in a table in Arcmap:

e.g.enter image description here

how can I set it to 2.60?

share|improve this question

2 Answers 2

up vote 10 down vote accepted

you can right click on the field name, click Properties, then press the ... next to Numeric and finally "rounding". You will then be able to format your number as you wish (well, it will be 2.61).

EDIT:

Just to make things clear, my initial answer is for visual rounding because field calculator was not mentioned in the question (I've added the tag). Now I have a few remarks.

Note that if you store your values in float, the "permanent" rounding may leave you with something like 5.599999999999996 (see here) because of the precision of the storage. So you might still want some "visual" rounding for display.

The second thing, as I mentioned, is that the rounding will bring you to the closest rounded value, but you seem to be looking for the floor. To solution would then be

math.floor(!fieldname!*100)/100 # 2.60855654 --> 2.60

Finally, if you want rounded values in a field, I recommand you to manage your field in order to store a given level of precision. When you add your new field, you can set the "precision" to the number of significant digit (in your case 5), and the "scale" to the number of decimal digits (in your case, 2). The rounding will then be automatic.

share|improve this answer
2  
+1 Nice, simple solution. Although, the process should be: right-click field name > Properties... > Numeric ... > Rounding –  Aaron Mar 14 at 15:24
    
+1 for pointing out what the ACTUAL value will be.. –  evv_gis Mar 14 at 15:26
    
mpianka is right. the numeric value will remain the same. –  KDot1254 Mar 16 at 21:28

The previous answer will round the number in ArcMap, but it does not actually change the numeric value. For example if you were to export the table to an Excel spreadsheet, the number would still read 2.6085...

To permanently round numbers to the nth value, use the following Python code in the Field Calculator:

round ( !FIELDNAME!, n)

share|improve this answer
    
Doesn't work using ArcGIS 10.1 with Python 2.7 –  PROBERT Jul 23 at 16:06

Your Answer

 
discard

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.