pop-os / launcher

Modular IPC-based desktop launcher service
Mozilla Public License 2.0
228 stars 45 forks source link

Remove "approx." keyword and improve decimal point/comma handling #71

Closed nathansgithub closed 2 years ago

nathansgithub commented 2 years ago

If you use the calculator plugin to calculate a number with more numbers after the decimal place than can be shown, it puts the word "approx." in front of the result. Ex: Typing "= 8/7" returns the response "= approx. 1.1428571". This is a minor annoyance because if you want to make another calculation based on the first response, you have to delete the word at the beginning of the answer first.

Could we change this behavior to only show the numeric response? I found that setting the Unicode parameter "-u8" to the qalc command causes the output to use a "≈" instead of adding "approx.", and made a PR (#70) to do that. The existing code already handles "≈" the same way as an equals sign.

While testing this, I also found that if you set the decimal to be a comma in qalc, you have to explicitly change it back if you want to use a decimal point, so I also added that small change to #70.

Thanks! Let me know any feedback you have.


Pop!_OS 21.04
Gnome 3.38.5

pop-launcher:
  Installed: 1.1.0~1638290853~21.04~98e3866
  Candidate: 1.1.0~1638290853~21.04~98e3866
  Version table:
 *** 1.1.0~1638290853~21.04~98e3866 1001
       1001 http://ppa.launchpad.net/system76/pop/ubuntu hirsute/main amd64 Packages
        100 /var/lib/dpkg/status