mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 02:42:48 +00:00
kdecore: update note in KLocale::formatNumber()
kcalc is no more, the plasma applet (which i rewrote too) is there for such things. for complex operations there is the plasma (krunner) plugin Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
db09a0d58a
commit
6dbd6b5a8e
1 changed files with 1 additions and 3 deletions
|
@ -267,9 +267,7 @@ QLocale::MeasurementSystem KLocale::measureSystem() const
|
||||||
QString KLocale::formatNumber(double num, int precision) const
|
QString KLocale::formatNumber(double num, int precision) const
|
||||||
{
|
{
|
||||||
if (precision <= 0) {
|
if (precision <= 0) {
|
||||||
// NOTE: kcalc for example passes 0 for precision but the constants should no be round
|
// precision is automatically chosen here for prettiness
|
||||||
// otherwise the whole meaning of Pi (3.14) being non-rounded number is lost so instead of
|
|
||||||
// forcing a number rounding the precision is automatically chosen here
|
|
||||||
return d->locale.toString(num, 'f', qRound(num) == num ? 0 : 2);
|
return d->locale.toString(num, 'f', qRound(num) == num ? 0 : 2);
|
||||||
}
|
}
|
||||||
const QString cnum = QString::number(num);
|
const QString cnum = QString::number(num);
|
||||||
|
|
Loading…
Add table
Reference in a new issue