GNOME Bugzilla – Bug 752839
General format rendering of 8.37 for very wide case
Last modified: 2015-08-18 12:09:28 UTC
Created attachment 308098 [details] round display bug Hi I've come accross a strange bug with the round function displaying much more decimals than expected. Tested on Archlinux 64 with gnumeric 1.12.22. The first column 1, 2, 3 4, … The second column is : =round(-log10(power(0.3,$A1)),2) At 17 and 18, it bugs and displays far more than 2 decimals. However, there is a catch, the column has to be resized wide enough. Otherwise, all seems to work ok. On Linux Mint 17.1 with gnumeric 1.12.9 it has the bug also.
The ROUND function has nothing to do with how many decimals are displaced. You would do that either with the cell format or the text function, e.g. =text(-log10(power(0.3,$A1)),"0.00"). ROUND changes the value to the closest representable value to the number obtained by rounding to two decimals. See http://www.gnumeric.org/numerical-issues.html
Although as Andreas says, using the formatting is the right thing to do for controlling display, this is a bug. However, it doesn't look like round is at fault. =837/100 produces the same long result, but we're supposed to pick the shortest string that has the right value. That would suggest a problem in go_dtoa.
Not go_dtoa. It gets told to render a certain precision and does that. If told get render the shortest representation it delivers "8.37". go_render_general is current suspect.
This problem has been fixed in our software repository. The fix will go into the next software release. Once that release is available, you may want to check for a software upgrade provided by your Linux distribution.
While it is harder to reproduce the bug it still exists on 0.10.23. The width of the column has to be precisely adjusted to contain 8.36999999999. Too large or too small and it displays 8.37. If I copy paste special only value, I can also trigger the bug. If I directly enter 8.37, it also bugs. On my screen, I have to set the width to 139 pixels (140.25 point). The header always shows 8.37.
Please try https://git.gnome.org/browse/goffice/commit/?id=bdb4376ff49b44e16f7127bd2c34d089b94c0bd2
Believed fixed.