Bug 507525 - Kalk doesn't understand decimal separators
Summary: Kalk doesn't understand decimal separators
Status: RESOLVED FIXED
Alias: None
Product: Kalk
Classification: Applications
Component: General (other bugs)
Version First Reported In: 25.04.3
Platform: Flatpak Linux
: NOR major
Target Milestone: ---
Assignee: hanyoung
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-07-26 20:18 UTC by jamal_ali1989
Modified: 2025-08-14 04:10 UTC (History)
2 users (show)

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


Attachments
The result of the bug (7.00 KB, image/png)
2025-07-26 20:18 UTC, jamal_ali1989
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jamal_ali1989 2025-07-26 20:18:11 UTC
Created attachment 183546 [details]
The result of the bug

My locate uses commas instead of dots as a decimal separator. However, the app fails to realize this, when I put in commas as decimal separator it interprets it in a completely different way, so using fractions is basically impossible
Comment 1 jamal_ali1989 2025-07-26 20:19:18 UTC
My locate uses commas instead of dots as a decimal separator. However, the app fails to realize this, when I put in commas as decimal separator it interprets it in a completely different way, so using fractions is basically impossible
Comment 2 jamal_ali1989 2025-07-26 20:19:29 UTC
My locate uses commas instead of dots as a decimal separator. However, the app fails to realize this, when I put in commas as decimal separator it interprets it in a completely different way, so using fractions is basically impossible
Comment 3 Albin 2025-07-27 11:22:43 UTC
Could you specify precisely what locale you're using and make sure it's enabled in your locale config files. As the locale sv_SE works fine for me with commas as decimals.
Comment 4 jamal_ali1989 2025-07-27 12:21:02 UTC
When you use commas, don't you get those weird square brackets? 
So, this is my locale file: 
LANG=en_GB.UTF-8
LC_MEASUREMENT=en_DE.UTF-8
LC_MONETARY=de_DE.UTF-8
LC_NUMERIC=de_DE.UTF-8
LC_TIME=de_DE.UTF-8
Comment 5 Albin 2025-07-27 13:46:11 UTC
Yeah - with the same locales as you, it does produce the same result. I'll get to work fixing it.
Comment 6 jamal_ali1989 2025-07-27 14:11:34 UTC
(In reply to Albin from comment #5)
> Yeah - with the same locales as you, it does produce the same result. I'll
> get to work fixing it.

If I may ask, do those brackets mean some other mathematical operation or it is simply a bug?
Comment 7 Bug Janitor Service 2025-07-31 23:11:54 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kalk/-/merge_requests/119
Comment 8 Devin Lin 2025-08-01 00:33:00 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 501116, bug 501190

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 9 Devin Lin 2025-08-06 15:16:10 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 501116, bug 501190

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
Comment 10 jamal_ali1989 2025-08-13 21:48:36 UTC
When will this update be pushed to Flathub? It is still 25.04.3 there.
Comment 11 Devin Lin 2025-08-14 04:10:25 UTC
(In reply to jamal_ali1989 from comment #10)
> When will this update be pushed to Flathub? It is still 25.04.3 there.

Hello, 25.08 is coming out today, it should be in Flathub in the near future.

https://community.kde.org/Schedules/KDE_Gear_25.08_Schedule