March Challenge - Calculator

I had an idea a while ago to see if I could build a reasonably functional calculator in Glide. I decided to give it a shot and came up with one that actually works pretty well. It’s nothing fancy like a scientific calculator, but it handles the basics (addition, subtraction, multiplication, division). OK, it turned out to have a lot more functionality than originally planned. It took a lot of trial and error to work out most of the bugs and have it work how I would expect a basic calculator to work. It’s mostly modeled after the built in calculator on my android phone with some functionality that I felt made it easier to use.

I think I got most bugs taken care of, but I’m sure there’s still a few of them. If anybody runs into anything that doesn’t look right, feel free to let me know.

Edit: Changed the logic so the below no longer applies and appears to be working with the changes.
I did run into the dreaded issue with Set Columns not permanently writing to a table through a single relation. It’s on the part that tracks the history of the last ten calculations. It seems to save them locally on the device until the app is restarted. Then all the data in those 10 rows are lost. (Data is sourced from user specific columns via single value columns, but it is not written to user specific columns, so I see no reason why it shouldn’t work. If anybody at Glide care’s to take a look, here is the support link.
Glide

Edit 2 There are still some bugs that are mostly noticeable on the published version of the app. Glide is aware, so hopefully they will get fixed in the future. They are all detailed in the Instructions tab in the side menu of the app.

My challenge to the rest of you is to see if you can achieve something similar or better. It was a good mental exercise for me to work through all the logic of how a calculator should work, along with all the different testing scenarios. It further made me realize that there are a handful of features that I wish glide had built in, which means some of the logic is a bit of a workaround.

The entire app is contained in Glide Tables only, and uses only 53 rows.

Now At the end of the month I’ll share a version that can be copied.

NEW - Still working out some bugs, but I added some scientific calculations.

19 Likes

hahaha, amazing!
You won’t believe this, but I actually started doing the exact same thing a month or so ago. I got as far as being able to add two numbers together, but then I had to put it aside as I had too many other things to work on. Here’s what mine looked like when I abandoned it:

Yours looks much more polished, and obviously way more functional - and I’m guessing you’re re-using some of those CSS tricks from the roster calendar we did a while back?

4 Likes

Sleak! I love the simple design and how I can seamlessly use the previous calculation.

Any reason why the previous calculations in the inline list are clickable?

1 Like

@Darren_Murphy Ha, nice! Maybe you’ll have to find some free time to work on yours again.
As for CSS, no, there is zero CSS in this one. Just a regular tile inline list that’s 4 wide.

@nathanaelb Thanks for the catch. I removed the ability to click on the inline list.

5 Likes

woah, nice!
arrg… I want so badly to have another go at this now…

3 Likes

:rofl: :rofl: :innocent:

1 Like

Awesome as usual.

an option: click on last calculation to recall the result. a kind of M recall !!

1 Like

That’s a good idea. Shouldn’t be too hard to implement.

1 Like

@Jeff_Hager I have been looking to do the exact same thing the last couple of days - creating a calculator. I suppose this a normal thing to do with a “new” software tool - do some basic functionality which different programs can do. But how easy can it be done - and can you do it yourself.

You are some much further ahead of me, Jeff, my idea is mostly in my head and that is hard to share :crazy_face:

I would like to look under the hood - but I can see that I have to wait to end of March - and then you are also challenging us. Hmm, of course it could be a great challenge to beat Master Jeff. I might though just return to my mouse hole and wait :slight_smile:

Fantastic job, Jeff !

2 Likes

And how many tables/columns? :thinking: (or do you mean 1 table with 27 columns?)

2 Likes

At the intersection of the white cross that separates four grey squares, am I the only one that sees a light grey dot? (optical illusion)

If you see it, good luck unseeing it! :sweat_smile:

2 Likes

Beautiful!

1 Like

This is simply beautiful Jeff, as always.

1 Like

A Driver table with one row and 18 columns. A table with 16 rows and 20 columns for the buttons. And a final table with 10 rows and 4 columns to track history (might add a few more columns in the history table to implement the memory recall feature).

Oh yeah, and some tricky custom actions. Not complicated, but a handful of If/Then logic to make the proper things happen.

4 Likes

Hehe, I noticed the optical illusion too. May have to tweak some colors or something to make it less noticeable.

Very cool Jeff,

1 Like

Nice exercise Jeff!

2 Likes

@Manu.n I’ve now added an option to recall any of the prior calculations.

2 Likes

Holy cow

2 Likes

@Jeff_Hager by curiosity, how do you manage to click and set like digits?

1 Like