denissimon / formula-parser

Parsing and evaluating mathematical formulas given as strings.
MIT License
76 stars 24 forks source link

Parse IF operator #2

Closed dmarcos89 closed 6 years ago

dmarcos89 commented 7 years ago

Hi @denissimon great work!

Any clue on how to parse something like this: if(condition;action1;action2), if(condition;action1;if(condition;action1;action2)), etc?

Thanks

denissimon commented 6 years ago

Hi! Thank you. First off, sorry for the late response, was very, very busy at my work for a company. As for your question, such conditional expressions are not supported. It’s more related to programming languages than to mathematical formulas. Thus, I think you can try to use PHP "if" statement with combination of Formula Parser library to achieve your goal.