johnqevil/Kerbanomics — pull request #4 by divisionbyzero1 (2014-12-27 05:16:41+00:00)
Title: working compound interest

Looks like auto-merge won't work for this pull request. It's probably because I created the "test-APR" branch directly from your 0.1.5 master. I'll send this in as it is. You can always create your own pull request to your master from my test-APR as well or send me a line and I'll create a new pull request.

Notes:
this should create working compound interest

it also fixes issues for when the player takes multiple loans. It treats the second loan as obtaining enough funding to fully pay back the existing debt and so increases the size of the new loan accordingly. The previous calculations erased the old debt.

it also fixes issues with loan payback. These issues were introduced with non-integer loan payments obtained with compound interest calculations. The new logic in PayLoan() function should handle overpayment correctly and prevents the player from putting in more money than needed.

cheers,
DivisionByZero