Bug 152674 - Calc: Wrong locale in formulas
Summary: Calc: Wrong locale in formulas
Status: RESOLVED DUPLICATE of bug 151886
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.4.2.3 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-25 16:37 UTC by Lenge
Modified: 2022-12-25 17:42 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 Lenge 2022-12-25 16:37:09 UTC
Description:
Since from 7.4.2 (or shortly before), Calc started using the wrong locale for number formatting within formulas. This seems to be linked to the "Use English function names" setting.

Setup:
* LibreOffice 7.4.3 running on Windows 8.1 Pro 64-bit German
* LibreOffice Language Settings
  (Tools\Options...\Language Settings\Languages)
  - User interface: English (USA)
  - Locale setting: German (Germany)
* LibreOffice Calc settings
  (Tools\Options...\LibreOffice Calc\Formula)
  - Use English function names = On

So the LibreOffice UI is in English while all numbers within spreadsheets are entered and displayed using German locale with "," as decimal operator.

Now since 7.4.2 (or shortly before), this no longer works for numbers entered in formulas. However, it still works if cells values are entered directly (without using a formula).

Steps to Reproduce:
(1.) Run Calc with the above settings.
(2.) Directly enter a number into a cell (e. g. "4,2").
(3.) Now enter the same number as a formula (e. g. "= 4,2").

Actual Results:
Result for (2.):
The number is correctly recognized and displayed.

Result for (3.):
The number isn't regocnized, it MUST be entered as "= 4.1" (using "." as decimal seperator). However, when you do, it is still correctly displayed as "4,2" in the cell.

Expected Results:
Numbers should always recognized when entered using LO's locale setting, regardless if inside a formula or not (as it has always been).


Reproducible: Always


User Profile Reset: Yes

Additional Info:
I found that the bug is linked to the "Use English function names" setting (Tools\Options...\LibreOffice Calc\Formula).

In all LibreOffice versions before this bug, this setting controlled if function names are entered and displayed using their original (English) name instead of the localized name (e. g. "SUM" instead of German "SUMME").

However, this setting only referred to the function name itself. It did NOT affect the formatting of numbers within formulas, or whether "," or ";" had to be used to separate function arguments. So, with German locale, you always had to enter:

(1.) With "Use English function names" = On
"= SUM(4,2; 1,5)" --> Cell display: 5,7 (as expected)

(2.) With "Use English function names" = Off
"= SUMME(4,2; 1,5)" --> Cell display: 5,7 (as expected)

Now, since this bug was introduced, the behavior has changed:

(1.) With "Use English function names" = On
"= SUM(4.2; 1.5)" --> Cell display: 5,7 (bug: wrong number input locale)

(2.) With "Use English function names" = Off
"= SUM(4,2; 1,5)" --> Cell display: 5,7 (bug: still English function name)

So I guess the bug is caused by an improper handling of the "Use English function names" setting (possibly plus improper handling of UI language vs. locale setting).
Comment 1 Mike Kaganski 2022-12-25 17:42:15 UTC

*** This bug has been marked as a duplicate of bug 151886 ***