[Libreoffice-bugs] [Bug 134469] Textimport gives wrong number if not at least 4 digits are given with a decimal

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Tue Dec 1 13:09:16 UTC 2020


https://bugs.documentfoundation.org/show_bug.cgi?id=134469

Mike Kaganski <mikekaganski at hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |NOTABUG

--- Comment #7 from Mike Kaganski <mikekaganski at hotmail.com> ---
This is not a bug.

As michael.meisinger.mm correctly noticed in comment 4, this is related to the
locale used for the import, and the decimal/thousand separators used in the
locale. (However, note that OS settings for separators are not used in
LibreOffice; whatever you define as separators in system, LibreOffice will use
hardcoded comma as decimal separator for German locale, and dot for thousand
separator.)

So the string "353.121" is a correct *whole number* in de-DE, while it's a
valid *floating-point number* in en-US. "353.11334" is a valid floating-point
in en-US, but it is not a valid number at all in de-DE, because the thousand
separator is not separating thousands (groups of exactly three digits).

When you use German locale for CSV import (selected in the import dialog),
"353.121" is detected as number, gets converted, and then is displayed using
the default number format. "353.11334" is not detected as number, and thus is
imported as text (and you may see the different alignment of the two cells in
the result: 353121 gets aligned right, while 353.11334 gets aligned left; also
View->Value Highlighting may help see the effect).

When you import CSV, you need to select correct settings. You may e.g. select
en-US in the dialog's "Language" selector; or you may right-click and mark
required columns as "US English" there (if you want them recognized as correct
numbers) or "Text" (if you want them to stay text).

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20201201/66d3e0a9/attachment.htm>


More information about the Libreoffice-bugs mailing list