[GIS] Round decimal number in ArcGIS10.1

arcgis-10.1arcgis-desktoparcmapfield-calculator

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?

Best Answer

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.