ONLYOFFICE / DocumentServer

ONLYOFFICE Docs is a free collaborative online office suite comprising viewers and editors for texts, spreadsheets and presentations, forms and PDF, fully compatible with Office Open XML formats: .docx, .xlsx, .pptx and enabling collaborative editing in real time.
https://www.onlyoffice.com
GNU Affero General Public License v3.0
4.75k stars 1.08k forks source link

incorrect import of numbers (floats) from a CSV #2731

Open janxkoci opened 4 months ago

janxkoci commented 4 months ago

This issue is unique.

Operating System

Linux (DEB package)

Version information

7.5.1

Expected Behavior

Opening this as a separate issue as per https://github.com/ONLYOFFICE/DesktopEditors/issues/1544#issuecomment-2100921077

test file

Save the following data in a new test.csv file:

rep,A,B,C
boot0,5.752358097e-07,6.241771831e-07,6.999271312e-07
boot1,5.772195833e-07,6.96334089e-07,7.699275178e-07
boot2,5.740492503e-07,6.570095073e-07,7.349709959e-07
boot3,5.350701888e-07,7.284086319e-07,7.706726658e-07
boot4,6.040161158e-07,6.815208175e-07,7.795943224e-07
boot5,4.912695988e-07,6.104015119e-07,6.836477531e-07
boot6,5.790822242e-07,6.43826624e-07,7.618649987e-07
boot7,5.249489454e-07,6.669570975e-07,7.294331419e-07
boot8,6.030653684e-07,7.332421268e-07,7.659650011e-07

(This is part of an actual file I was working on when I discovered the issue.)

Reading the file into a spreadsheet should show correct values in cells.

Actual Behavior

Importing the above file and selecting any numeric cell will show wrong value in the formula bar. Changing numeric formats keeps showing wrong values - see steps to reproduce below.

Reproduction Steps

  1. Open the above file in OnlyOffice Desktop of version 7.5.1 or higher.
  2. Use UTF-8 encoding and comma as delimiter when prompted by OnlyOffice.
  3. Select any numeric cell and look at the formula bar (just above the cells) - it incorrectly displays the value as e.g. 0.000001 or even 0 (e.g. cell B7).
  4. Try selecting all numeric cells and convert to Scientific notation - most show the value of 1.00E-06, which is not correct.
  5. Try converting to number with 12 decimal points - you will get numbers like 0.000001000000.

Additional information

testing setup

I tried several versions of OnlyOffice, with older versions showing correct behaviour, while newer versions show incorrect behaviour. I noticed the issue first on my main laptop with OnlyOffice from flathub (version 8.0.1), then tried another laptop with OnlyOffice installed as deb package (7.4.0). After that I decided to test it with a few appimages to see when the bug started.

Correct
Buggy

notes

It's possible (likely) that version 7.5.0 is already affected, but I haven't tried it (the appimages are rather large and I mostly needed some working version on my main laptop, testing all version was not the main priority).

rsnegirev commented 4 months ago

Hi @janxkoci

I can confirm, this is the bug number 68007. When some fixes will be done we'll text you here in this issue.

And we're moving this issue to DocumentServer repo, since it's our base product and problem actual there too.

Thank you for the report!

rsnegirev commented 1 month ago

The bug was fixed in the commits below: https://github.com/ONLYOFFICE/core/commit/128e09f839c8c3fc7e0da351f36d44d5a298a126 https://github.com/ONLYOFFICE/core/commit/128e09f839c8c3fc7e0da351f36d44d5a298a126

Fixes will be released in the next major version.

janxkoci commented 4 weeks ago

Thanks @rsnegirev. Do you mean major version of DocumentServer or DesktopEditors?

rsnegirev commented 4 weeks ago

@janxkoci both of them!

janxkoci commented 4 weeks ago

I see, so that's 8.2, right?

rsnegirev commented 4 weeks ago

It's not exactly how we'll number the next version, but most likely yes.