We've noticed a discrepancy in the latest 9.1p build where the sum in the summary row shows a different value than was expected in 8.3. Take the sample. Notice that sum of "gdp" shows 167.5899999999999999999999999999999999999999....when it is supposed to show 167.59
Announcement
Collapse
No announcement yet.
X
-
So what's going on here is a behavior change in an area that has no specified behavior.
In your test code, the type of the field is not declared and effectively defaults to "text". Applying summaryFunction:"sum" to a text field has no specified behavior.
In 8.3 it happened to ultimately lead to rounding through a very circuitous process; the correct, supported way to get this behavior is to actually declare the field as type:"float" and set decimalPrecision.
Also, FYI, adding floating point numbers in any common programming language (JavaScript, Java, C..) leads to these kind of results. Here is one of many brief explanations, or if you want the incredibly long story, try this.
Comment
Comment