Equal logic

I’m currently working on fixing a bug in my calculator logic, specifically in the equal function. The issue seems to be related to how numbers and operators are being processed and evaluated.

Right now, when I press the equal button, the function doesn’t consistently return the correct result. Sometimes it fails to compute the expression properly, especially when multiple operators are involved or when chaining operations.

I suspect the problem lies in how I’m storing and parsing the input values—both numbers and operators—before passing them to the evaluation logic. There might be a flaw in the way I’m handling operator precedence or in how I’m converting the input into a valid expression.

If anyone has experience debugging calculator logic or managing dynamic input parsing, I’d appreciate any insights or suggestions!

Here’s my snippet of my blocks for equal function


here’s my logic for numbers and operators

Hello @anthroi, welcome to Thunkable! :tada:

The equal conditions are used because it is not possible to set the arithmetic calculation dynamically. So all the different blocks must be added, and a variable defines which must be executed.

Be sure to check out How to ask Great Questions v2.0, the Community Guidelines, and our Getting Started Guide to make the best of your Thunkable Community experience!