Photo by Dan Gold on Unsplash

When I go out for a meal with friends, it’s quite common that maybe someone isn’t drinking alcohol that evening, or someone else different dietary requirements, so splitting the bill evenly doesn’t quite work.

Then we get into trying to figure out how much did we all spend on booze, and therefore how much less should one person pay, and then how much is left to split between everyone else. It all gets a bit tedious – basically, we don’t much care, we just want to be able to knock a bit of someone’s bill, and/or add a bit extra to the person who ordered 3 cocktails, and for the whole amount to be covered. We also don’t want to spend a long time figuring out precisely who ordered what, down to the penny.

I’ve been wanting to play with Progressive Web Applications (PWAs) for a while, so this seemed like a nice little toy project to build.

Enter a total amount, and how many people are paying, and it starts off by dividing the bill evenly.

Then, simply override the amount for anyone who should be paying a bit more or a bit less, and all the other amounts will adjust accordingly, so that the total amount is still covered.

Because it’s a PWA, you can add it to your phone’s home screen just like a native application, and it works just fine offline, too.

You can see the application here, and the source code is here.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s