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:
Ivailo Monev 2024-03-14 00:05:17 +02:00
parent db09a0d58a
commit 6dbd6b5a8e

View file

@ -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);