Bug 148822 - Calc CSV import changes 0.117 to 117, when other numbers are 5 diggits (x.xxxx) Seems to happen with all numbers not 5 digits.
Summary: Calc CSV import changes 0.117 to 117, when other numbers are 5 diggits (x.xxx...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.1.4.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-27 14:35 UTC by Markus
Modified: 2022-04-27 15:02 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus 2022-04-27 14:35:58 UTC
Description:
I use a JavaScript script to save Data in a csv.
The Data is arranged this way:
x;y;z;name
0;0;0; Black
[...]
0.0577;0.0837;0.117; Swamp

The last digit of the 'swamp' colors z-value is cut off by my script due to being 0.
When opening the file with calc, the import dialogue shows the number correctly, the file does not. It shows 117.

Steps to Reproduce:
1. Create File with Data (at least several rows)
2. Open file with Data
3.

Actual Results:
117

Expected Results:
0.117


Reproducible: Always


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:
When the entry is 0.1170, the error does not occur.
Comment 1 Mike Kaganski 2022-04-27 15:02:45 UTC
It is not a bug. Your locale uses dot as thousand separator, and hence, when it matches the thousand position, the string "0.117" is interpreted as "zero thousand one hundred seventeen". When its position is not the correct thousand position (on 5th position from right, as in "0.0577"), it is not possible to convert such a string into a number, and the string is kept as string.

You need to either define the correct locale for the data, or to define en-US for the specific columns (if you use scripting, you would need to define filter settings, as described at [1]).

[1] https://help.libreoffice.org/latest/en-US/text/shared/guide/csv_params.html