Version: unspecified (using KDE 4.7.0) OS: Linux You cannot enter numbers larger than 9999 in the calculator (either with the mouse or with the keyboard). Calculator shows "0" after the fourth digit. Can this be related to the use of a latin (italian) locale? Reproducible: Didn't try Steps to Reproduce: Try entering 12345+1 Type 1 > On screen you get "1" Type 2 > On screen you get "12" Type 3 > On screen you get "123" Type 4 > On screen you get "1.234" Type 5 > On screen you get "0" Actual Results: See steps to reproduce Expected Results: The obvious one
Still present in 4.7.1
Confirmed in 4.7.1, Archlinux binaries.
On further inspection, the bug can be also reproduced with US english locale
Same problem in Kubuntu 11.10 (4.7.1)
Still buggy in 4.7.2. Please, consider removing the plasmoid altogether from the software compilation and readding when eventually fixed. Plasmoid has already remained broken through 3 point releases. Having broken stuff just creates confusion and kalgebra is a valid substitute anyway.
Seems to hasve an additional bug as well (4.7.2) - it doesn't like any numbers (even 4 digit ones) which have a 5 or a 6 in them - I'd agree with sergio, if this has been buggy since back at 4.7.1 or earlier, I'd go with "remove the entire plasmoid." We don't even need a calculator widget, this is why we have kcalc :)
I tried adding some kDebug lines like below. The result of currentValue is 0, may be something wrong at readNumber. void CalculatorApplet::slotDigitClicked() { Plasma::PushButton *clickedButton = qobject_cast<Plasma::PushButton *>(sender()); int newDigit = clickedButton->text().toInt(); if (inputText == QLatin1String( "0" ) && newDigit == 0.0) return; if (inputText.length() >= MaxInputLength) return; if (waitingForDigit) { inputText.clear(); waitingForDigit = false; } inputText += QString::number(newDigit); if (!inputText.contains(KGlobal::locale()->decimalSymbol())) { //If there is no decimal, then we need to reformat the number inputText = "1234567"; kDebug() << "Input =" << inputText; double currentValue = KGlobal::locale()->readNumber(inputText); kDebug() << "Current value=" << currentValue; QString localizedString = KGlobal::locale()->formatNumber(currentValue, 0); mOutputDisplay->setText(localizedString); } else { //Once we have a decimal, then all we have to do is append the number mOutputDisplay->setText(mOutputDisplay->text()+QString::number(newDigit)); } }
+1 to remove it if it's not going to be fixed
This bug is a duplicate of 288963 and the bug is not in the Calculator widget code but in kdelibs. I tracked down the faulty code but I am not sure I can fix it, this code is tricky. I'll do my best to have this fixed before 4.8 is out. *** This bug has been marked as a duplicate of bug 288963 ***