elementary / applications-menu

Applications Menu for elementary OS and the Pantheon desktop environment
https://elementary.io
GNU General Public License v3.0
103 stars 35 forks source link

unit conversion in calculator plugin #114

Closed joseph-long closed 2 years ago

joseph-long commented 6 years ago

In science and engineering, we frequently need to use physical units (and equally frequently, we forget the conversion factors). It would be great if there were a way to quickly get unit-ful quantities out of a calculation (similar to Spotlight and KRunner).

I haven't tracked down the exact place KRunner implements this, but they seem to have a pretty complete set of units and support for manipulating them in calculations. See the KDE wiki for examples.

The current implementation of the calculator plugin shells out to bc, which doesn't appear to have unit support. It seems like KRunner is using libqalculate under the hood which has built-in unit support, if introducing a dependency is acceptable.

Alternatively, is it possible for 3rd party apps to install plugins like the calculator one?

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/60677791-unit-conversion-in-calculator-plugin?utm_campaign=plugin&utm_content=tracker%2F62023936&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F62023936&utm_medium=issues&utm_source=github).
peteruithoven commented 6 years ago

Maybe calq that seems to be the cli of libqalculate

$ qalc 1+1
1 + 1 = 2
$ qalc 10mm to m
10 * millimeter = 0,01 m

For the curious: the current calculator-plugin