Select to view content in your preferred language

Field scale not working with double type when adding a new field

122
1
Tuesday
Labels (1)
Juanv1927
New Contributor

Hi everyone,

I’ve been trying to add a new field to my shapefile and have been struggling to set the precision and scale. I need a Double data type with a scale of 2 and the default precision, but every time I try, I either get an error message, or the field automatically changes to Float.

Juanv1927_2-1762269308661.png

 

I’ve tried several approaches—adding the field directly in the attribute table, using Add Field in ArcGIS Pro, and even exporting it back to a geodatabase—but the same issue persists.

I’ve read mixed information online about whether scale is supported in shapefiles, and I’m not sure what to believe at this point. 
Has anyone managed to make this work, or can confirm if it’s simply not supported?

 

Thank you all! 🙂

0 Kudos
1 Reply
HaydenWelch
MVP Regular Contributor

Here's the dBase file spec. Seems that there are flags for precision and length. Have you hovered over the red square to see what the error is? I just added a high precision Double field to a shapefile dbf on my end so I'm wondering what the error says.

 

1. 2 Field Descriptor Array

ByteContents
Description
0-3132 bytesField name in ASCII (zero-filled).
321 byteField type in ASCII (B, C, D, N, L, M, @, I, +, F, 0 or G).
331 byteField length in binary.
341 byteField decimal count in binary.
35-362 bytesReserved.
371 byteProduction .MDX field flag; 0x01 if field has an index tag in the production .MDX file; 0x00 if the field is not indexed.
38-392 bytesReserved.
40-434 bytesNext Autoincrement value, if the Field type is Autoincrement, 0x00 otherwise.
44-474 bytesReserved.
0 Kudos