Select to view content in your preferred language

Attribute Table with Double Field set to 1 Decimal Place has Inconsistent Rounding

1448
14
Jump to solution
07-18-2025 12:09 PM
Melissa_B
Frequent Contributor

In a feature class with a double field, some values are not rounding correctly when set to a reduced decimal place using the number format > Rounding > decimal places.

In the attached image, I have the same data in both fields. One is set to the default 6 decimal places. One is set to 1 decimal place.  Why is 1.15 shown as 1.1 but 1.55 shown as 1.6?  Why is 1.45 shown as 1.4 but 4.45 shown as 4.5?!

I've submitted this to ESRI support since it's happening on multiple computers, multiple ArcGIS Pro versions (3.4.3 and 3.5.2), different projects, and different feature classes, but I'm still over here confused like, has anyone else noticed this?!  I came across the issue because a dynamic text in a layout was not rounding some values correctly when set to one decimal place in the formatting. Then I was like "well what happens to an attribute table set to one decimal place?" The answer is the same behavior!  Am I crazy? Is there some secret rule to rounding numbers I never learned?  Do I have two computers with the same CPU error?

 

14 Replies
Melissa_B
Frequent Contributor

ESRI support has created a bug for this issue: BUG-000178046 

0 Kudos
NicoleJohnson
Frequent Contributor

@Melissa_B, could you post a link to the bug page? I'm not having any luck searching the bug number (because apparently Esri doesn't let you do that...? 🙄).

I'm curious because it just doesn't seem like a bug, it's a fundamental aspect of what a float is and how it can be stored. 

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

The Esri Support website does allow and work on searching bug numbers.  In this case, your search is not finding the defect because Esri has not publicly released the defect.  Defects logged through Esri Support do not automatically get made public, and some never get made public although most do.  I would wait another 2-4 weeks and check again.

NicoleJohnson
Frequent Contributor

Ohh, that makes sense, thank you!

Edit: I just remembered I tried searching a publicly available bug number earlier to see if it worked, and it seems to just go to a blank "search results" page. Have you tried this recently? Maybe the site is malfunctioning?

NicoleJohnson_0-1753476340730.png

 

 

 

 

0 Kudos
Melissa_B
Frequent Contributor

Public bugs can be searched by number on https://support.esri.com/en-us/search

Not all bugs are on the public list though; I think they have to be reviewed first, but I am also not super clear on what gets a bug or enhancement moved to the public list.

The attribute table and dynamic text "decimalPlaces" property only changes how the values appear to users - not how they are stored. So if they are only changing what is displayed to users by using a basic round function without accounting for the floating point problem, then users will get unexpected results; like when I had a polygon recorded as 1.15 acres but was showing as 1.1 acres when set to one decimal place in the dynamic text tag for a map. In my use case, I need the "rounded" values to be displaying the results of a typical round up operation and not a literal round on a floating point approximation.

The Arcade round function addresses the floating point problem - that's why there's a mismatch between what gets labelled using Arcade round() and what gets shown in the attribute table with the same number of decimal places.  Additionally, whatever language/bit of code is handling the decimalPlaces property in ArcGIS Online is also handling the issue and rounding up as you would expect. The inconsistencies between label and attribute table and the operation of the "decimalPlaces" property between ArcGIS Pro and ArcGIS Online very much seem like a bug to me.

There are several programmatic methods to "round" a floating point value to display to users of a software that better matches the intent behind a stored value.  Several methods are outlined here for C++: https://java2blog.com/round-to-2-decimal-places-cpp/

Also, if the attribute table were consistently being true to floating point values, then when I entered 1.15 into a field set for 6 decimal places, it should show me 1.149999. Instead, the attribute table is displaying 1.15 - so there is already some level of operation being performed when it is showing the "full" value in the table to hide the approximation.  Why hide the approximation in the table set to more decimal places than intended but not address that same issue when "rounding" to fewer decimal places?

I've learned my lesson though when I had to change 246 dynamic text tags in 82 layouts to use the Arcade round function instead of the decimalPlaces property. (yes, I desperately wish these layouts could be a map series but there's no effective method I've found for placing insets within a map series that doesn't cause some amount of manual work for each map)

0 Kudos