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 126444 - '-0' instead '0' in a exported text file
'-0' instead '0' in a exported text file
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: import/export Text
1.2.x
Other Linux
: Low trivial
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2003-11-07 15:24 UTC by Frederic Parrenin
Modified: 2010-06-30 16:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The gnumeric file that shows the problem (1.84 KB, application/x-gnumeric)
2003-11-07 15:25 UTC, Frederic Parrenin
Details
This is the gnumeric file to reproduce the Bug. (1.67 KB, application/x-gnumeric)
2003-11-08 07:43 UTC, Frederic Parrenin
Details

Description Frederic Parrenin 2003-11-07 15:24:07 UTC
If I open this .gnumeric file and save it as a text file (with configurable
text export), I obtain:
-0 0
as a first line.
Why exporting '-0' instead of '0' ?
Comment 1 Frederic Parrenin 2003-11-07 15:25:13 UTC
Created attachment 21272 [details]
The gnumeric file that shows the problem
Comment 2 Morten Welinder 2003-11-07 18:24:11 UTC
Confirmed.  Looks mighty silly.
Comment 3 Morten Welinder 2003-11-07 18:25:40 UTC
Hmm...  the file contains "-0".  Any ideas why that came about?

      <gmr:Cells>
        <gmr:Cell Col="0" Row="0" ValueType="40">-0</gmr:Cell>
        <gmr:Cell Col="1" Row="0" ValueType="40">0</gmr:Cell>
        <gmr:Cell Col="0" Row="1" ValueType="40">1000</gmr:Cell>
        <gmr:Cell Col="1" Row="1"
ValueType="40">-4.5949999999998</gmr:Cell>
        <gmr:Cell Col="0" Row="2" ValueType="40">2000</gmr:Cell>
        <gmr:Cell Col="1" Row="2"
ValueType="40">-8.63900000000012</gmr:Cell>
        <gmr:Cell Col="0" Row="3" ValueType="40">3000</gmr:Cell>
Comment 4 Frederic Parrenin 2003-11-07 19:39:14 UTC
I think it comes from an xls file that somebody sent to me.
I don't know more.
Thanks for the quick reply.
      Frédéric
Comment 5 Jody Goldberg 2003-11-07 19:50:48 UTC
Would we be able to get a copy of the xls file in question ?
It can be kept confidential if necessary.
Comment 6 Frederic Parrenin 2003-11-08 07:42:09 UTC
In fact, it was not from an excel file.
It was from a standard gnumeric file where I had imported some text data.
I attach a .gnumeric file.
The operations to reproduce the problem are:
-go to a free cell (for example D1) enter '-1' and press 'Return'
-go to celle D1 and copy it (Ctrl-C)
-select cells A1-A3
-go to 'paste special', and select 'as value' and with the
multiplication operation. Validate.
-Now, export as configurable text

=> the last line is '-0 0'

Sincerely.  Frederic
Comment 7 Frederic Parrenin 2003-11-08 07:43:03 UTC
Created attachment 21293 [details]
This is the gnumeric file to reproduce the Bug.
Comment 8 Morten Welinder 2003-11-08 19:14:07 UTC
The value really is -0 (a perfectly valid ieee bumber).

stf_export_cell uses value_get_as_string (it shouldn't) and that comes
down to a printf.
Comment 9 Andreas J. Guelzow 2004-10-21 14:42:29 UTC
Morten:

Why shouldn't stf_export_cell use value_get_as_string?
Comment 10 Morten Welinder 2005-03-24 18:01:10 UTC
Andreas: value_get_as_string generates stuff whose main property is that the
Gnumeric parser will take it.  There is no reason to tie our text output to
whatever arbitrary choices went into that.

Of particular concern will be the special values like -0, +/-Inf, and the
many NaNs.
Comment 11 Frederic Parrenin 2006-04-15 11:06:20 UTC
This is still present in 1.6.3.
Comment 12 Andreas J. Guelzow 2010-06-30 16:41: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.

Note that this fix only occurs in the "Auto" formatting. If you export "raw" we assume you want to see the numbers as they are currently stored, ie. -0 would be possible.