Bug 154475 - kcalc shows a 2 commas as result
Summary: kcalc shows a 2 commas as result
Status: RESOLVED DUPLICATE of bug 159168
Alias: None
Product: kcalc
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Mandriva RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Klaus Niederkrüger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-22 16:21 UTC by Michael Braun
Modified: 2008-06-11 22:17 UTC (History)
0 users

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


Attachments
kcalc.png (28.72 KB, image/png)
2007-12-22 16:22 UTC, Michael Braun
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Braun 2007-12-22 16:21:07 UTC
Version:            (using KDE KDE 3.97.0)
Installed from:    Mandriva RPMs

I want to get the result of "8800 / 1024" and kcalc shows as result "8,,59375". Attached is a screenshot which shows the result.
Comment 1 Michael Braun 2007-12-22 16:22:17 UTC
Created attachment 22651 [details]
kcalc.png
Comment 2 Markus Grob 2008-02-28 21:56:57 UTC
I have the same with KCalc 2.2 in KDE 4.0.1. If you change the language settings in KDE, you will see, that one "," will change too, if you change the sign for the tousands. I think, one is wrong and the other "," is wrong too, because I have the "." for separting the decimals.
Don't know, from where kcalc takes this signs.
Comment 3 Markus Grob 2008-02-28 22:55:08 UTC
I think, I know, which bug this is. The 2 commas come from 2 different things. 1 is the decimal separator and one is the separator from the tousands, but it is implemented in a wrong way, i think.

If I have read the code in a right way, the separator position is set at the 3 position from right and so on. The problem is, it is counted real from right. It is not shown, if the numbers are separated with decimals.

I think, the solution is at follows:

- get position of decimalseparator
- Insert a tousendseparator to the left side all 3 numbers until the left end of string is reached
- Insert a space to the right side all 3 numbers until the right side of the string is reached.

This produces the following:

1'234'567.890 123 45

If liked, this isn't hardcoded then could be taken from lokal or from the kcalc menu. This, because the sign for the tousends isn't the same as for separating the digits after a wished position.

If possible, you could change the background every 3 numbers from the decimal separator at the left and right side. In this way, you don't need to take at look at the locale separator.
Comment 4 David Johnson 2008-06-11 22:17:39 UTC

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