Bug 350066 - Multiplications with x (instead of *) append x to the result
Summary: Multiplications with x (instead of *) append x to the result
Status: RESOLVED FIXED
Alias: None
Product: krunner
Classification: Plasma
Component: calculator (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Alexander Lohnau
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-09 21:09 UTC by Albert Astals Cid
Modified: 2020-08-04 00:53 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.20


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Albert Astals Cid 2015-07-09 21:09:01 UTC
=5779x3691 says 21330289x

I guess it should either not work at all with x and just work with * or if it's going to work with x too it should not append one to the end.
Comment 1 Kai Uwe Broulik 2016-04-21 19:41:12 UTC
When I now enter =5779x3691 I just get no result whatsoever.
Comment 2 Christophe Marin 2020-07-17 19:53:04 UTC
Still valid.

Additionally, '=3×2' returns garbage
Comment 3 Alexander Lohnau 2020-07-19 06:52:03 UTC
>Additionally, '=3×2' returns garbage

Well it depends on how you interpret the x. The engine thinks of x as a variable, consequently the statement 3x2 gets interpreted as 3*x*2.

But from a usability point of view the bug makes sense, I will look into writing a patch :-).
Comment 4 Christoph Feck 2020-07-19 09:37:29 UTC
This is not 'x' but '×'. Behavior probably depends on whether the calculator runner is compiled against libqalculate or plain javascript.
Comment 5 Bug Janitor Service 2020-07-19 09:42:51 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/163
Comment 6 Nate Graham 2020-08-04 00:53:53 UTC
Git commit 668feb3e17809f3da0f1a2b6a36b95d970d7e694 by Nate Graham, on behalf of Alexander Lohnau.
Committed on 04/08/2020 at 00:53.
Pushed by ngraham into branch 'master'.

Allow x and multiplication symbol instead of *
FIXED-IN: 5.20

This will allow us to run queries like:
4x4
4x4,2
4x,2

But if we explicitly want the x to be interpreted as a
variable by qalculate we can run:
=4x*4

M  +23   -1    runners/calculator/calculatorrunner.cpp
M  +1    -0    runners/calculator/calculatorrunner.h

https://invent.kde.org/plasma/plasma-workspace/commit/668feb3e17809f3da0f1a2b6a36b95d970d7e694