Commit 7f672f1d authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

converterrunner: Do not round values unnecassarily

We pass in the precision when we format the string
and the rounding causes internal issues when the value is casted to an
int.

Test Plan:
Large queries like `100000000000000000000000000000000000000000$` no
longer produce negative results.

CCBUG: 425790

This fix can also be backported for Plasma 5.21.
parent 04c4d02a
......@@ -98,7 +98,6 @@ void ConverterRunner::match(Plasma::RunnerContext &context)
match.setType(Plasma::QueryMatch::HelperMatch);
match.setIconName(QStringLiteral("accessories-calculator"));
if (outputUnit.categoryId() == KUnitConversion::CurrencyCategory) {
outputValue.round(2);
match.setText(QStringLiteral("%1 (%2)").arg(outputValue.toString(0, 'f', 2), outputUnit.symbol()));
} else {
match.setText(QStringLiteral("%1 (%2)").arg(outputValue.toString(), outputUnit.symbol()));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment