Bug 154011 - Numeric sort doesn't work when using non-dot decimal character specified by locale
Summary: Numeric sort doesn't work when using non-dot decimal character specified by l...
Status: RESOLVED INSUFFICIENTDATA
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.3.7.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-06 14:56 UTC by zrx8
Modified: 2023-10-28 03:13 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
the bug is not present (67.44 KB, image/png)
2023-03-30 12:53 UTC, claudiuv
Details

Note You need to log in before you can comment on or make changes to this bug.
Description zrx8 2023-03-06 14:56:39 UTC
Description:
rows before sort:

17,97968
18,00363
17,22748

rows after sort:

17,97968
18,00363
17,22748


Steps to Reproduce:
1. create the sheet containing the above numbers
2. sort it


Actual Results:
nothing changes

Expected Results:
numerically sorted rows


Reproducible: Always


User Profile Reset: No

Additional Info:
Please note that comma is used as decimal character, as it is the decimal character of the regional format setting (Hungarian) in my Ubuntu 22.04.1.

If I replace commas with dots, the sorting is performed correctly.

However, Hungarian locale is selected in the L.O. Calc's tools/options/language settings, and comma is set as decimal separator ("Same as locale setting" is checked)

Now there seem to be 2 problems:

1. calc is probably not aware of the decimal character of the locale

2. even if calc doesn't treat these cells as numbers, it still doesn't explain, why the rows are not sorted alphabetically (which would result the same, as if they'd be sorted numerically)
Comment 1 Eike Rathke (retired, only occasionally showing up) 2023-03-06 15:42:21 UTC
That rather indicates that your 17,22748 value is of type Text instead of Numeric, numeric values sort before text values. Check your data. Activate View -> Value Highlighting (Ctrl+F8), numeric values will be displayed in blue, text values in black, formula results in green. If all values are of numeric type then attach a sample document here.

See also
https://wiki.documentfoundation.org/Faq/Calc/How_to_convert_number_text_to_numeric_data
Comment 2 claudiuv 2023-03-30 12:53:09 UTC
Created attachment 186315 [details]
the bug is not present
Comment 3 claudiuv 2023-03-30 12:53:42 UTC
Version: 7.5.0.3 (x86) / LibreOffice Community
Build ID: c21113d003cd3efa8c53188764377a8272d9d6de
CPU threads: 2; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: ro-RO (ro_RO); UI: en-GB
Calc: threaded
Comment 4 QA Administrators 2023-09-27 03:15:44 UTC Comment hidden (obsolete)
Comment 5 QA Administrators 2023-10-28 03:13:38 UTC
Dear zrx8,

Please read this message in its entirety before proceeding.

Your bug report is being closed as INSUFFICIENTDATA due to inactivity and
a lack of information which is needed in order to accurately
reproduce and confirm the problem. We encourage you to retest
your bug against the latest release. If the issue is still
present in the latest stable release, we need the following
information (please ignore any that you've already provided):

a) Provide details of your system including your operating
   system and the latest version of LibreOffice that you have
   confirmed the bug to be present

b) Provide easy to reproduce steps – the simpler the better

c) Provide any test case(s) which will help us confirm the problem

d) Provide screenshots of the problem if you think it might help

e) Read all comments and provide any requested information

Once all of this is done, please set the bug back to UNCONFIRMED
and we will attempt to reproduce the issue. Please do not:

a) respond via email 

b) update the version field in the bug or any of the other details
   on the top section of our bug tracker

Warm Regards,
QA Team

MassPing-NeedInfo-FollowUp