For those of you who need a simple loan calculator or to revert calculations performed by the VFP payment() function, there is a new download at the
www.foxite.com forum.
*----------------------------------
YPAYLOAN.exe
This function is similar to the standard VFP payment() function.
Like VFP payment() function it returns
- Amount of each periodic payment on a fixed-interest loan.
Additionally ypayloan() makes 'revert' calculations returning:
- Loan Amount,
- Number of Periodic Payments,
- Fixed Year Rate.
Syntax examples. Let us suppose there is:
- Loan amount 98000;
- Fixed year rate 6.875%;
- Three years period, 360 months
1. Calculate monthly payment (analog of VFP payment() function):
?ypayloan(nLoanAmount, nFixedYearRate, nMonths).
?round(ypayloan(98000,0.06875, 360),2) returns 643.79
2. Calculate loan amount:
?ypayloan(.f., nFixedYearRate, nMonths, nPayPerMonth) or;
?ypayloan(, nFixedYearRate, nMonths, nPayPerMonth).
?round(ypayloan(,0.06875, 360,643.79),0) returns 98000
3. Calculate number of payments:
?ypayloan(nLoanAmount, nFixedYearRate, .f., nPayPerMonth) or;
?ypayloan(nLoanAmount, nFixedYearRate, , nPayPerMonth).
?round(ypayloan(98000,0.06875, ,643.79),0) returns 360
4. Calculate Fixed Year Rate:
?ypayloan(nLoanAmount, .f., nMonths, nPayPerMonth, nPrecision) or;
?ypayloan(nLoanAmount, , nMonths, nPayPerMonth, nPrecision).
?ypayloan(98000,,360,643.79,0.00001) returns 0.06875
*---------------------------------
So far YPAYLOAN.exe was tested in VFP6 SP3, Windows95, Windows98, WindowsNT.
I will appreciate comments, suggestions, bug reports and opinions.
Please feel free to contact me at rubinov@juno.com
*--------------------------------