Bug 501190 - Calculating with decimals uses comma , instead of period .
Summary: Calculating with decimals uses comma , instead of period .
Status: RESOLVED FIXED
Alias: None
Product: Kalk
Classification: Applications
Component: General (other bugs)
Version First Reported In: 24.12.3
Platform: Flatpak Linux
: NOR major
Target Milestone: ---
Assignee: hanyoung
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-07 15:27 UTC by maartaan
Modified: 2025-08-06 15:15 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 25.08.0
Sentry Crash Report:


Attachments
Depicts the problem I have and my region and language settings (169.54 KB, image/jpeg)
2025-03-07 15:27 UTC, maartaan
Details
Comma interpretation bug (135.78 KB, image/png)
2025-07-30 21:34 UTC, openusr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description maartaan 2025-03-07 15:27:39 UTC
Created attachment 179208 [details]
Depicts the problem I have and my region and language settings

SUMMARY
When calculating a number with a decimal the answer uses a comma , instead of a period . so when I try to later multiplicate the answer it turns out all wrong. The decimal button on the calculator also uses , instead of .
If I write it with a . instead of , manually on my keyboard then it calculates fine. 

STEPS TO REPRODUCE
1. Calculate a number with a decimal answer
2. Use the answer from previous calculation and multiplicate it

OBSERVED RESULT
9/4=2,25
2,25x4=[2 100]

EXPECTED RESULT
9/4=2.25
2.25x4=9

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.3.2
KDE Frameworks Version: 6.11.0
Qt Version: 6.8.2
Kernel Version: 6.13.5-zen1-1-zen (64-bit)
Graphics Platform: Wayland
Processors: 12 × Intel® Core™ i7-8700K CPU @ 3.70GHz
Memory: 15.6 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1080 Ti
Comment 1 openusr 2025-07-30 21:34:20 UTC
Created attachment 183664 [details]
Comma interpretation bug
Comment 2 openusr 2025-07-30 21:40:22 UTC
Second that, see screenshot above.

Seems that Kalk interprets comma in a very unusual way: it treats comma as a kind of separator; not sure what square brackets mean, but the second result (2,9...) on the screenshot is the result of division 82 / 28 (which is, of cause, quite unexpected).

Interestingly, Kalk won't let me input a dot as a decimal separator (it seems to ignore the dot key press).
Comment 3 Bug Janitor Service 2025-07-31 23:11:57 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kalk/-/merge_requests/119
Comment 4 Devin Lin 2025-08-01 00:32:52 UTC
Git commit b452c5a3460b78fe6deff3ff9d95f7ca21838c28 by Devin Lin, on behalf of Albin ZE.
Committed on 31/07/2025 at 23:12.
Pushed by devinlin into branch 'master'.

Fix: Correctly handle locale-specific decimal separators
Related: bug 507525, bug 501116

Fixes a bug where locales that use a comma for decimals, like de_DE, would break calculations. The comma wasn't being converted to a period for the math engine, leading to it being misinterpreted and causing weird results. This now handles the conversion before and after the calculation.

This was originally created as
https://invent.kde.org/utilities/kalk/-/merge_requests/118, but was
updated by @devinlin to expedite getting the fix in due to its severity.

M  +6    -1    src/qalculateengine.cpp

https://invent.kde.org/utilities/kalk/-/commit/b452c5a3460b78fe6deff3ff9d95f7ca21838c28
Comment 5 Devin Lin 2025-08-06 15:15:54 UTC
Git commit 445b382f56ff83261edf70b2f2b14f5ee84cb4f0 by Devin Lin, on behalf of Albin ZE.
Committed on 06/08/2025 at 15:13.
Pushed by devinlin into branch 'release/25.08'.

Fix: Correctly handle locale-specific decimal separators
Related: bug 507525, bug 501116

Fixes a bug where locales that use a comma for decimals, like de_DE, would break calculations. The comma wasn't being converted to a period for the math engine, leading to it being misinterpreted and causing weird results. This now handles the conversion before and after the calculation.

This was originally created as
https://invent.kde.org/utilities/kalk/-/merge_requests/118, but was
updated by @devinlin to expedite getting the fix in due to its severity.

M  +6    -1    src/qalculateengine.cpp

https://invent.kde.org/utilities/kalk/-/commit/445b382f56ff83261edf70b2f2b14f5ee84cb4f0