# Microproject: Joint Expenses Calculator

I recently built a small side project to help calculate joint monthly expenses based on income, given that few couples will have perfectly even salaries. You can check it out here.

It is as MVP as it gets: just basic JavaScript and HTML, with Tachyons for simple styling support.

The gist here is the entire calculate function, which admittedly could have used clearer variable names.

The formulas are as follows, which are based on yearly gross (pre-tax) income.

Your contribution to household income per year as a percentage:

```
x = (a / (a + b))
```

Your partner’s contribution to household income per year as a percentage:

```
y = (b / (a + b))
```

Your share of the monthly expenses:

```
(x * z)
```

Your partner’s share of the monthly expenses:

```
(y * z)
```

Where:

**a** = your yearly gross salary.

**b** = your partner’s yearly gross salary.

**x** = Your percentage of household income.

**y** = Your partners percentage of household income.

**z** = Total monthly household expenses.