The following script was taken from a Mortgage Calculator.
The html form is not included as requested. However, the
following values entered will return:
Loan Amount 127000.00
Down Payment 12000.00
Annual interest Rate 18.5%
Number of Years 30
--------------------------------------------------
Total Number Payments 360
Monthly Payment Amount $1780.13
If you want to see the calculator itself
http://www.studiodeluxe.net/calculator/
I'll leave it up for a little while......
Rythmist
<script language="JavaScript">
function JSRecalc()
{
form = document.form1
LoanAmount= form.LoanAmount.value
DownPayment= form.DownPayment.value
if (DownPayment == "") {
DownPayment = "0"
}
AnnualInterestRate = form.InterestRate.value/100
Years= form.NumberOfYears.value
MonthRate=AnnualInterestRate/12
NumPayments=Years*12
Prin=LoanAmount-DownPayment
MonthPayment=Math.floor((Prin*MonthRate)/(1-Math.pow((1+MonthRate),(-1*NumPa
yments)))*100)/100
form.NumberOfPayments.value=NumPayments
form.MonthlyPayment.value=MonthPayment
}
</script>
-----Original Message-----
Date: Saturday, September 19, 1998 6:22 PM
Subject: Re: WC:>: Mortgage calc scripts needed
>At 05:18 PM 9/19/98 +0200, Ivan Sergio Borgonovo so eloquently stated:
>>On 18 Sep 98, at 18:32, Jack Killpatrick wrote:
>>
>>> Hi All,
>>
>>> Anyone know of a source for some public domain perl or javascript
scripts
>>> for doing various mortgage calculations? I'm looking for code,
>not web pages
>>> with calculators on them.
>>
>>Sorry but what motgage is exactly?
>>If it is:
>>I have X $$$ in the bank, evry year they become X $$$ + 5%... how
>>many $$$ I'll have after 10 years?
>>The formula is
>>Money(initial capital=$,number of years=y,interest=%)=
>>$+$*%^y+y*$*((1-%^y)/(1-%)-1)
>>where if interest=10% %=10/100=0.1
>>and ^ means raised to.
>>
>
>If it were so easy. With a mortgage, the first half of the life
>of the mortgage most money goes to interest. Hence they use a
>different formula, i.e., Rule of 78's.
>
>G
____________________________________________________________________
--------------------------------------------------------------------
Join The Web Consultants Association : Register on our web site Now
Web Consultants Web Site : http://just4u.com/webconsultants
If you lose the instructions All subscription/unsubscribing can be done
directly from our website for all our lists.
---------------------------------------------------------------------