1

Working with a feature class in an enterprise GDB (SQL Server) which has a numeric field with type Double - precision 10, scale 3 - but is displaying trailing zeros on a lot of the values e.g. 265.360000.

What can be done to remove the trailing zeros from the field?

Edit: The issue appears to only be in the display of the values within ArcMap and not how the values are being stored in the database.

6
  • 1
    You specified that you wanted 6 places to the right (10-3-1), and you got it. If you defined the column "precision 6, scale 3" you'd get "265.36". Trailing zeros don't use any storage -- why would they matter?
    – Vince
    Commented Feb 16, 2016 at 2:15
  • Simple answer is because they're harder to read. You've lost me with your comment "you wanted 6 places to the right" - I want maximum of 3 decimal places, which is why I use scale of 3.
    – Midavalo
    Commented Feb 16, 2016 at 2:25
  • @Vince is saying "precision 10, scale 3" > 10-3-1 = 6 decimal places, "precision 6, scale 3" > 6-3-1 = 2 decimal places. I haven't tested to verify that, but I trust his knowledge generally, and particularly in this area. Also, where is it displaying the trailing zeros? i.e. Attribute Table or elsewhere?
    – PolyGeo
    Commented Feb 16, 2016 at 3:26
  • Yes in the attribute table. According to Esri documentation Scale refers to number of decimal places, Precision is the max size of the field, so the way I read that is I can have a max of 10 digits, including 3 decimal places. Shouldn't get to 6.
    – Midavalo
    Commented Feb 16, 2016 at 3:29
  • ArcSDE defines display in terms of "width" and "dec_digits". I've never seen "precision" and "scale" in reference to a table before, so I figured this was some weird Microsoft terminology, with a left side width. It would help to edit the question to specify that you're referring to the table view in Desktop.
    – Vince
    Commented Feb 16, 2016 at 4:15

1 Answer 1

1

The specificity of the number of places can be set when you create the field. ESRI's help page provides this overview:

If you find that numeric values are being cut off or rounded in the table, right-click the field, click Properties, then review the number formatting. Since six is the default number of decimal places to display in the Table window, you may need to increase this value to see the full number.

For example, if you have a table in an ArcSDE geodatabase containing a field of type double with a scale of eight, the last two digits are dropped off because the Table window only displays six decimal places by default.

Increasing the number of decimal places will allow you to see all the digits. Similarly, you can decrease the number of decimal places if you want to see fewer in the Table window.

If you want to adjust your current table view to reduce the number of zeros after you have created it. Then you can use the python parser in the tables properties section, you can enter:

[Name].lstrip("0")

That should move any trailing zeros

1
  • 1
    Thanks @whyzar, that's where the issue was. It was displaying extra zeros, not actually storing them.
    – Midavalo
    Commented Feb 16, 2016 at 3:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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