You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However this introduce a new issue for following express:
2+3x5
It expect 17 instead of 25. The issue is that x should be calculate first before + and -. Since x 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.
The text was updated successfully, but these errors were encountered:
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: "/")
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 symbols
However 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.
The text was updated successfully, but these errors were encountered: