Since the video was created, there was an error on the Equal Sign Button, here is the equation that works: UpdateContext({varCalculate: varCalculate & varNumber}); Switch( varCalcType, "Plus", UpdateContext({varNumber: Text(Left(lblCalculate.Text,Len(lblCalculate.Text) - (Len(varNumber)+3)) + Value(lblNumber.Text))}), "Subtract", UpdateContext({varNumber: Text(Left(lblCalculate.Text,Len(lblCalculate.Text) - (Len(varNumber)+3)) - Value(lblNumber.Text))}), "Multiply", UpdateContext({varNumber: Text(Left(lblCalculate.Text,Len(lblCalculate.Text) - (Len(varNumber)+3)) * Value(lblNumber.Text))}), "Divide", UpdateContext({varNumber: Text(Left(lblCalculate.Text,Len(lblCalculate.Text) - (Len(varNumber)+3)) / Value(lblNumber.Text))}) ); UpdateContext({varToggle: true});
@@AltafKhan-mm4sz I tested it, have it working right now. Here is the equation I used. The only issue was the 2nd number was not using the Length and trying to calculate "5 +" it needed to remove the space and the " +" symbol. UpdateContext({varCalculate: varCalculate & varNumber}); Switch( varCalcType, "Plus", UpdateContext({varNumber: Text(Left(lblCalculate.Text,Len(lblCalculate.Text) - (Len(varNumber)+3)) + Value(lblNumber.Text))}), "Subtract", UpdateContext({varNumber: Text(Left(lblCalculate.Text,Len(lblCalculate.Text) - (Len(varNumber)+3)) - Value(lblNumber.Text))}), "Multiply", UpdateContext({varNumber: Text(Left(lblCalculate.Text,Len(lblCalculate.Text) - (Len(varNumber)+3)) * Value(lblNumber.Text))}), "Divide", UpdateContext({varNumber: Text(Left(lblCalculate.Text,Len(lblCalculate.Text) - (Len(varNumber)+3)) / Value(lblNumber.Text))}) ); UpdateContext({varToggle: true});
Something that would be fun for a potential part 2. In the windows calculator, if you say add 5 to 6, it returns 11. But when you press equals again, it takes that 11 and applies the last operation (the +6) to that, so you can keep looping over 1 operation in a way. I, ofr one, would be curious how you would achieve that effect in this calculator build
That's a good question. There probably would need to be some sort of variable that changes true/false depending on if you hit another "number" button or not. If you don't hit a new "number" button it just does the previous calculation.
Hello Andrew, Frist ,Thank you for this video second , when i add two or more digits like (12 + 24)... i get a " the value 12 + cannot be converted to a number" can yo help me to solve this error ?
Hi Andrew, thank you for this video,7:21 On the numbers I used UpdateContext({varNumbers: varNum & Self.Text}). 10:46 I used a collection for the top label that shows the equation. But I don't think I could of worked it out before watching your video first.
Good Point 😁 Yeah I was just seeing how fast I could create one, not that anyone should copy the exact example. There's def some things that could be done to fix the app to perfection.
The difference between low-code programming and real programming. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-sBJmRD7kNTk.html Why reinvent the wheel? We have to focus on the algorithms and creation part.
Thanks for sharing Victor, You can always do the "real" coding part in Power Apps too, just use Power Apps Framework: learn.microsoft.com/en-us/power-apps/developer/component-framework/overview