I run the following Excel function to calculate weekly re-payments.
CELL B4 = 15000
=(PMT(6.5%/12,60,(-B4),(0.2*B4),1))*12/52
Where 6.5% = rate, 60 = number of payments, 0.2*15000 = balloon and *12/52 is for calculating weekly repayments.
The output of the above is 57.62, however when coding it up in JS I end up with 77.11 as the result. After checking through it several times I can't seem to find where I've gone wrong.
Calculation for PMT is done as follows.
var q = Math.pow(1 + rate_per_period, number_of_payments);
return -(rate_per_period * (future_value + (q * present_value))) / ((-1 + q) * (1 + rate_per_period * (type)));
I've created a fiddle showing my PMT calculations.
Also, I am using an almost exact copy of the accepted answer in another question here on SO but mine varies slightly.