Bug 52369 - ksysguard doesn't respect locale settings for numbers
Summary: ksysguard doesn't respect locale settings for numbers
Status: RESOLVED FIXED
Alias: None
Product: ksysguard
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: KSysGuard Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-12-28 23:00 UTC by Hans Petter Bieker
Modified: 2002-12-30 18:38 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hans Petter Bieker 2002-12-28 23:00:19 UTC
Version:           1.2.0 (using KDE 3.1.9)
Compiler:          gcc version 3.2
OS:          Linux (i686) release 2.4.18-4GB

KSysGuard should use KLocale::formatNumber() instead of QString::setNum or QString::number to convert integers or doubles into strings. If not, KSysGuard will use wrong decimal separators and there will be no group separators.
Comment 1 Tobias Koenig 2002-12-29 11:45:22 UTC
Subject: Re:  New: ksysguard doesn't respect locale settings for numbers

On Sat, Dec 28, 2002 at 10:00:23PM -0000, Hans Petter Bieker wrote:
Hi Hans,

> KSysGuard should use KLocale::formatNumber() instead of QString::setNum
We do not use QString::setNum in the sources at all. Where did you find
this code?

> or QString::number to convert integers or doubles into strings.
The only place we use QString::number is in SensorManager. It is used
to convert integers in a range from 0 to 25 into strings. No problems
with doubles here.

Ciao,
Tobias
Comment 2 Hans Petter Bieker 2002-12-29 13:19:06 UTC
> > KSysGuard should use KLocale::formatNumber() instead of QString::setNum 
> We do not use QString::setNum in the sources at all. Where did you find 
> this code? 
 
Okay, sorry. I haven't checked the code, I have only used KSysGuard as a 
black box. 
 
> > or QString::number to convert integers or doubles into strings. 
> The only place we use QString::number is in SensorManager. It is used 
> to convert integers in a range from 0 to 25 into strings. No problems 
> with doubles here. 
 
Change your locale to use "," as decimal separator. Then look at "User%" 
and "System%" in the process table. They will still use ".". I guess 
the reason is that ksysguard doesn't convert the input from the backend 
using KLocale::formatNumber(). 
 
HOWTOFIX: All integers and doubles should be converted using something 
like this: 
KGlobal::locale()->formatNumber(str.toDouble()) before displaying.. 
 
Comment 3 Tobias Koenig 2002-12-29 19:53:56 UTC
It should be fixed in CVS HEAD now. 
 
Thank you for the report 
Comment 4 Hans Petter Bieker 2002-12-30 18:38:50 UTC
KLocale::formatNumber should also be used on large integers. 
 
* Process Table: VmSize, VmRSS 
* Status line: Memory: %1 KB used, %2 KB free... And swap 
* Signal plotter (e.g. Clock Frequency) 
* Disk partition table