After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 500356 - Add-decimals problem for exponential formats
Add-decimals problem for exponential formats
Status: RESOLVED FIXED
Product: libgoffice
Classification: Other
Component: General
unspecified
Other All
: Normal normal
: ---
Assigned To: Andreas J. Guelzow
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2007-11-29 04:50 UTC by Morten Welinder
Modified: 2007-11-29 20:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix for this problem (523 bytes, patch)
2007-11-29 08:26 UTC, Andreas J. Guelzow
none Details | Review
modified patch (538 bytes, patch)
2007-11-29 17:40 UTC, Andreas J. Guelzow
committed Details | Review

Description Morten Welinder 2007-11-29 04:50:24 UTC
enter 34.34 and format that cell in scientific notation with no decimals
at all. Now increasing the precision of the cell increases the precision
of the exponent rather than the mantissa.
Comment 1 Andreas J. Guelzow 2007-11-29 08:26:36 UTC
Created attachment 99832 [details] [review]
fix for this problem

This should handle the scientific notation.  Please review!
Comment 2 Morten Welinder 2007-11-29 14:24:29 UTC
Hmm... three minor things.

1. Move the common "g_string_append_c (res, t);" out of both branches and put it after the "if" statement.

2. In the last_zero>=0 case, use g_string_insert_len (res, last_zero + 1, ".0", 2);

3. In the last_zero==-1 case you should probably simply append ".0".
   That would handle #E+00".
Comment 3 Andreas J. Guelzow 2007-11-29 17:40:32 UTC
Created attachment 99851 [details] [review]
modified patch

Morten: is this what you had in mind?  Please review.
Comment 4 Morten Welinder 2007-11-29 19:20:38 UTC
Go for it!
Comment 5 Andreas J. Guelzow 2007-11-29 20:50:23 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.