That looks awesome! I like the personalization options!
I would agree that it’s definitely been a challenge and I definitely learned a lot. I learned some new techniques, what I’d like to see improved by Glide (IF/Then logic), and definitely relearned some math that I haven’t touched since high school and college.
It will be interesting to see how we approached the same problems.
I think my next goal will be to add some specialty calculators. Like financial and volume/area type calculators. Maybe even some date calculations.
@gvalero hehe, yeah, it was supposed to be “basic”, but I just kept going.
Completely agree on what you say about the parenthesis. I was stuck with forcing the order of operations. Basically I have a value to the left of the operation (+, -, x, /) and a value to the right, then based on that math operation, I determine which calculation to do. Up until a few days ago, I was just taking the the calculated result and moving it to the left part of the calculation whenever you pressed one of the operation buttons. I still do that but I also save the friendly formatted version of it. Underneath, it’s still using the number from the previous calculation. (confused yet? ) I added the extra parenthesis to indicate that everything inside the parenthesis was already calculated first and using the underlying result. If you look at @Krivo’s version, you can better see what I mean. I’m guessing he is doing something very similar, but moving the result to the left side and displaying it.
It comes down to a Glide limitation. I couldn’t find a way to build a complete math formula and use a single math column to calculate it.
So to use your example, this is what is happening behind the scenes, so it will calculate in this order:
3-1 = 2
Pressing / gives you:
(2)/2 = 1
Pressing + gives you:
(1)+3 = 4
Pressing / gives you:
(4)/5 = 0.8
Technically not correct in the math world if you consider the formula as a whole, but if you calculate it piece by piece in the right order, then it would give you the correct result of 3.1. It’s kind of the same limitation with very basic calculators. They don’t handle complex formulas
Like I said, I wanted to show the entire formula instead of the previous result, but the only way for it to make sense mathematically was to force the parenthesis. Maybe something to think about in the future, unless glide begins to allow us to build formulas with template columns and then plug them into a math column. That would simplify a lot of this.
I made my calculator app copyable - so you can have a look under the hood.
Please use your own cloudinary account if you want the Personalization - free to work. You simply put in you cloudinary account (cloud_name) in the General table, copy the two images below to you account - and you are up and running.