Bug 446045 - Currency conversion does not activate when using currency symbols before the number, only after the number
Summary: Currency conversion does not activate when using currency symbols before the ...
Status: RESOLVED FIXED
Alias: None
Product: krunner
Classification: Plasma
Component: converter (other bugs)
Version First Reported In: master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Alexander Lohnau
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2021-11-24 19:47 UTC by Nate Graham
Modified: 2026-09-22 02:22 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.9.0
Sentry Crash Report:


Attachments
currency converter in krunner (146.94 KB, image/jpeg)
2021-12-01 15:08 UTC, paninomaninodesu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2021-11-24 19:47:34 UTC
"12 USD" shows currency conversions, but "$12" does not.
Comment 1 Kai Uwe Broulik 2021-11-24 20:36:00 UTC
12$ works through the currency runner whereas $12 is only done through the qalculate runner.

I guess the heuristic of "number + suffix" in the unitsrunner doesn't apply for all cases.
Comment 2 paninomaninodesu 2021-12-01 15:08:14 UTC
Created attachment 144116 [details]
currency converter in krunner

Strange.
"12 USD" works, "12$" also works, but "$12" kinda don't?
The first two shows the results from the currency converter, the last one shows the result from the calculator, and the calculator result is different.
"12$" shows the results from both.
Comment 3 Bug Janitor Service 2026-06-10 12:43:44 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kdeplasma-addons/-/merge_requests/1077
Comment 4 Nate Graham 2026-09-22 02:22:19 UTC
Git commit be3d15e2a91783979a03d98751c589383a1952f3 by Nate Graham, on behalf of Alex Čižinský.
Committed on 22/09/2026 at 02:22.
Pushed by ngraham into branch 'master'.

runners/converter: Rework query parsing

Allow using currency units before the value (eg. `usd 10` or `$10 to gbp`).
Units before value are allowed only for currency units, this is because
otherwise there might be some ambiguous situations, (like `m21`: `21 meters`
vs `1 meter squared`), also non-currency units are usually not put before
their value. See bug 446045.

Add `=`, `=>` and `->` as conversion delimiters; `->` was already used by
libqalculate in the calculator runner, `=` and `=>` were added as other
options.

Add support for scientific notation (eg. `1.4e7 mm => km`).
(QString::toDouble, which is used for parsing the number already supported
scientific notation, so the only part that didn't was the query parsing
code.) 

Fix incorrect handling of queries containing a conversion word multiple
times (eg. `10 in in ft`).

Add new tests for the new behavior.
FIXED-IN: 6.9.0

M  +19   -0    runners/converter/autotests/converterrunnertest.cpp
M  +66   -19   runners/converter/converterrunner.cpp
M  +3    -2    runners/converter/converterrunner.h

https://invent.kde.org/plasma/kdeplasma-addons/-/commit/be3d15e2a91783979a03d98751c589383a1952f3