Open mingchen opened 4 hours ago
The issue is that there's currently no way to set operator precedence externally.
I'll think about a good way to expose this.
Probably the best solution for you for now is just to do a character replacement on the string before passing it to expression e.g. string.replacingOccurences(of: "÷", with: "/")
Thank you. Looking forward to an improvement.
First, thank you for this library—it's simple yet powerful.
As a calculator, I'd like to use
x
÷
instead of*
/
. I tried to pass custom symbolsHowever this introduce a new issue for following express:
It expect 17 instead of 25. The issue is that
x
should be calculate first before+
and-
. Sincex
is a custom operator, it can not be treat the same as*
.If + - * / operators can be customized would be great and can avoid this kind of issue.