Jonathan Bergknoff: Compound Interest

submited by
Style Pass
2025-01-04 00:30:25

My wife and I recently started paying two of our kids allowance. One of them likes to spend it, while the other likes to save it. I looked into opening a bank account so our saver could earn a return on the money, but it was too complicated. We don’t have any brick-and-mortar banks in walking distance from our house, and an online bank may make deposits and withdrawals tricky. There’s also questions of joint ownership or custodianship. Too serious for this age and amount of money.

I decided instead that we parents could act as the bank. Actually, I had toyed with this idea a few years ago and even made a Google Sheet for it. Looking at the spreadsheet, I saw that there was a formula implemented in “Apps Script” for computing the balance at a date:

Apparently I had written it a few years ago (the idiosyncratic JavaScript style is undeniably mine 😁), but neglected to write comments, so now I was puzzled by it [1]. It boils down to this:

Leave a Comment