Skip to content

Instantly share code, notes, and snippets.

@rs77
Last active August 29, 2015 14:21
Show Gist options
  • Save rs77/77b49f8dd40eb5de86ec to your computer and use it in GitHub Desktop.
Save rs77/77b49f8dd40eb5de86ec to your computer and use it in GitHub Desktop.
var p = 25000, // principal amount
i = 0.06, // annual interest rate over the life HP
n = 60, // number of periods in life of HP
y = 12, // number of payment periods per annum
t = true, // if payment is to be made in ADVANCE
r = 1 + ( i / y ), // interest rate per period = 1.005
S_n = ( (r^n) - 1 ) ) / ( r - 1 ), // limiting sum of payments = 69.77
repay; // repayments per period
if ( t ) S_n *= r; // = 70.12
repay = (p * ( r^n )) / S_n; // = 480.92
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment