Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mortgage calculater formula

Status
Not open for further replies.

Kurjo

Programmer
May 13, 2003
67
US
Does anyone know the formula to calculate mortgage payment. I know that we can do it in Excel easily, but I want to get the formula to put it in a VFP program.

Thanks
 
I am looking for the formula for amortization table. The prameters will be Loan amount, intrest rate and term.
 
You can build something around the PAYMETN() function. From the BOL:
Code:
PAYMENT(nPrincipal, nInterestRate, nPayments)

Mike Krausnick
Dublin, California
 
Code:
Amortize30_360(150000, 7, 360)


PROCEDURE Amortize30_360
LPARAMETERS tnBal, tnRate, tnTerm
LOCAL nPmt, nPriorBal, i

	m.nPmt = PAYMENT(m.tnBal, m.tnRate/1200, m.tnTerm)
	m.nPriorBal = m.tnBal

	FOR m.i = 1 TO m.tnTerm
		m.tnBal = m.tnBal  - m.nPmt + m.tnRate / 1200 * m.nPriorBal 
		m.nPriorBal = m.tnBal
		?"Period Remaining " + TRANSFORM(m.tnTerm - m.i) + CHR(9) + TRANSFORM(NTOM(m.tnBal))
	ENDFOR 
ENDPROC
 
Thanks guys. Looks like I got enough info to work with.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top