Loan Amortization Calculator

Email
 Submitted on: 1/6/2015 3:51:00 PM By: Rob Swiger (from psc cd) Level: Beginner User Rating: By 3 Users Compatibility: ASP (Active Server Pages), HTML Views: 1844

Calculates montly payments for a loan depending on loan amount, interest and length of loan. Perfect for mortgages or any loan!

Can't Copy and Paste this?
 ```'************************************** ' for :Loan Amortization Calculator '************************************** This code is free to use and distribute for non-profit or commercial use. I would appreciate an email just to let me know how you are using it!```
code:
Can't Copy and Paste this?
 ``` '************************************** ' Name: Loan Amortization Calculator ' Description:Calculates montly payments for a loan depending on loan amount, interest and length of loan. Perfect for mortgages or any loan! ' By: Rob Swiger (from psc cd) ' ' Inputs:1) Loan amount 2) Interest amount (%) 3) Length of loan (in years) ' ' Returns:1) Monthly payment 2) Total interest paid '************************************** <%@LANGUAGE="VBSCRIPT"%> <% dim intAmount 'Amount of loan; priciple. dim intInterest 'Amount of interest in %. dim intPayment 'Monthly payment amount. dim intLength 'Length of loan. dim intTotInterest 'Total interest paid over length of loan. %> infinidev.com - Amortization Calculator <% 'Check to see if form has been submitted. if len(request.form("isSub")) > 0 then 'Check if all fields have information entered if len(request.form("amount")) > 0 and len(request.form("interest")) > 0 and len(request.form("length")) > 0 then 'Populate amount variable with amount field from form. intAmount = request.form("amount") 'Populate interest variable by using interest form field divided by '100 to make decimal (7% / 100 = 0.07), then divide by 12 for monthly interest. intInterest = (request.form("interest") / 100) / 12 'Populate length of loan variable by taking length from form field (in years) 'and dividing by 12 to get total months. intLength = request.form("length") * 12 'Calculate payments and round off to 2 decimal places. (\$100.00) intPayment = round(intAmount * intInterest/(1 - (1 + intInterest) ^ (-intLength)),2) 'Covert integer to US currency format. intPayment = formatcurrency(intPayment,2) 'Calculate total interest paid over length of loan. intTotInterest = round((intPayment * intLength) - intAmount,2) 'Covert integer to US currency format. intTotInterest = formatcurrency(intTotInterest,2) else 'Alert user that all boxes must be filled in. response.write("ALL BOXES must be filled in!") end if end if %>

Loan Amortization Calculator

Amount of Loan (in US dollars): ">
Annual Interest Rate (%): ">
Term of Loan (in years): ">
<% if len(intPayment) > 0 then response.write("
") response.write("

") response.write("Your monthly loan payment will be:
") response.write("") response.write(intPayment & "

") response.write("

") response.write("") response.write(intTotInterest & "

") response.write("
") end if %>

Calculator provided free by:
infinidev, llc

```

Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)

There are no comments on this submission.

Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)