svenstaro / rofi-calc

🖩 Do live calculations in rofi!
MIT License
964 stars 31 forks source link

Correctly handle multiple equals signs emitted by qalc #80

Closed SabrinaJewson closed 2 years ago

SabrinaJewson commented 2 years ago

Given some inputs like 1 + 1/2 qalc will emit a result with several = signs:

1 + (1 / 2) = 3/2 = 1 + 1/2 = 1.5

Previously, rofi-calc considered the result of this calculation to be 3/2 = 1 + 1/2 = 1.5 which is not right. By searching for the equals sign from the right instead of the left, we will always correctly identify the result - in this case, 1.5.