I wrote a routine to compare instalment payments but the value returned by Math.Payment is off by 16 cents v. Excel (or v. my actual car payment calculated by Honda...)
So I wrote my own function and it is bang on with Excel and Honda.
Function Payment1 (amt: real; rate:real; years:word; PperYear:word):double;
VAR
rpp: double;
BEGIN
rpp := rate/PperYear;
Payment1 := -amt * rpp / (1-Power(1+rpp,-years*PperYear));
END;
Call:
Pmt := -Payment1(Cap,Rate,Yrs,PPY);
How I call the Math.Payment:
Pmt := -Payment(Rate/PPY, Yrs*PPY, Cap, 0, ptstartofperiod)
Where rate is 0.0199, PPY is 26, Yrs is 3, Cap is 15904.20, 0 is 0 (!), ...
Correct result (Excel, Honda and my function) = 203.90.
Math.Payment result = 203.74.
... anyway I'll stick with my function for now...