Quote:Ray,
example would be 100,000 loan
6% rate
30 year or 360 months
payment should be 599.55
any help would be appreciated
glenn and james
For compatibility purposes, Sesame's @PMT function works identically to the one in Q&A. By converting the 6% APR to a monthly rate, I get $589.37. However, this differs slightly from your number.
I looked up the formula used by the online calculators (which match your numbers). By using this formula in SBasic, I was able to match the results provided by an online mortgage calculator.
Function CalcPayment(vRate as Double, vMonths as Double, vPrincipal as Double) as Double
var vPmt as Double
var vInterest as Double
vInterest = (vRate / 1200)
vPmt = (vInterest + (vInterest / (@EXP(1 + vInterest, vMonths) - 1))) * vPrincipal
Return(vPmt)
End Function
So, the following line of code would print the result you expect.
WriteLn(CalcPayment(6, 360, 100000))
If you want to see the math, the formula is available here:
http://www.1728.com/loanform.htm