Field Calculating: need to display two decimal places

18014
4
Jump to solution
01-26-2015 07:37 AM
Highlighted
New Contributor

I'm attempting to calculate a field to show acres, displayed to 2 decimal places. 

I've got field A  representing area in sq. ft..  I've created a new field  B to represent area in acres (to 2 decimal places).

When I created field B (for acres) I specified precision of 2.  I've attempted both short and long integers for field type.  In Field Calculator (for field B) I enter the phrase  "A/43560'  It calculates the field alright.  Problem is, it's returning the answer, but it's rounding to the nearest whole number.  (any acreage below 0.5 is displaying as 0)

How do I make it display Acres to two decimal places?

Thanks much in advance,

Dave

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Esri Esteemed Contributor

When creating the field the field scale sets the number of decimal places stored in a field. This parameter is only used in Float and Double data field types.

... but:  If the input table is a personal or file geodatabase the field scale value will be ignored.

You can change the display properties of a field. In the attribute table, right click on the field header (the name) and select "properties". Next click on the button next to Numeric:

FieldProperties.png

In the numeric format dialog, change the number of decimals:

FieldPropertiesNumeric.png

View solution in original post

Reply
0 Kudos
4 Replies
Highlighted
Occasional Contributor

If you need a 2 decimal visualization only, you can set that in the "Field Properties". There, inside the Numeric properties set the decimal places to 2. and you get the field. Also, if you need the value itself set to 2, you can use field calculator in your new field with this code Round("Field1",2).

Finally, remember that for decimal places you need a "Double" or "Float" data type. Not an "integer" type

Reply
0 Kudos
Highlighted
New Contributor

Marco,

Thanks for your input.  I typed the following

Round("Area_Acres",2)

in the Field Calculator, but I get error message

"Error running VBA code: Expected identifier"

Reply
0 Kudos
Highlighted
Esri Esteemed Contributor

When creating the field the field scale sets the number of decimal places stored in a field. This parameter is only used in Float and Double data field types.

... but:  If the input table is a personal or file geodatabase the field scale value will be ignored.

You can change the display properties of a field. In the attribute table, right click on the field header (the name) and select "properties". Next click on the button next to Numeric:

FieldProperties.png

In the numeric format dialog, change the number of decimals:

FieldPropertiesNumeric.png

View solution in original post

Reply
0 Kudos
Highlighted
New Contributor

That solves it Xander.  Thanks for your help!

Dave

Reply
0 Kudos