/    Sign up×
Community /Pin to ProfileBookmark

Payment Calculator

I’m trying to figure out how I should go about doing this. I know how to do it on paper but I’m not sure which language I need to use, so I can make a payment calculator on my website. Here’s what I want to do,

I’d like to have it laid out so there is drop menus being interest rate, finance amount and term of loan and each menu has a few different options to select and each option would have a value that would be calculated with the next drop down to produce a final monthly or biweekly amount in 2 text fields.

[B]Payment Calculator[/B]

Interest Rate: (drop menu with different interest rates here)
Finance Amount: (drop menu with different finance amounts here)
Term of Loan: (drop menu with different terms here)

Monthly Payment: (text field with calculated monthly payment)
Bi-Weekly Payment: (text field with calculated bi-weekly payment)

Calculations example: for the option selected in the interest rate menu, for example 2%, it would be multiplied with the option selected in the finance amount menu, for example $10,000. So then $10,000 would be added with 200 and equal $10200 and then that amount would be divided by the term of loan, for example 5 years(60 months,120 weeks). Then the end result would produce the monthly amount, example $170, and the bi-weekly amount, example $85).

Is this possible with javascript? If so, is there a tutorial someone may no of that would be helpful to me or if anyone has done this before how did you do it. I know how to set up the drop menus and titles and text fields on a page in html but not sure how to give each option in the drop menus a value and how to make them calculate the end result. Thanks for your time!

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@Calvert_TripesiFeb 26.2011 — This kind of thing comes up on forums all the time. You could try the search function, or just Google: javascript +payment calculator
Copy linkTweet thisAlerts:
@jalarieFeb 26.2011 — I don't think that you properly understand how the bank calculates interest. For your example of $10,000 at 2% for 5 years, the monthly payment is $175.28.
Copy linkTweet thisAlerts:
@andy1212authorFeb 27.2011 — To be honest I'm actually trying to figure out how to make a payment calculator for a client that I've designed a website for and he wanted the calculator on his website but I don't remember how to calculate interest and monthly or biweekly payments. My client also wanted me not to include the interest or total after the term just the monthly or biweekly payments. I found a formula I=Prt just now for simple interest and can see I already made a mistake with the interest calculations lol but ok I'll search javascript+payment calculator and see what comes up. I'll post here with my results. Thanks for your help!
Copy linkTweet thisAlerts:
@jalarieFeb 27.2011 — The I=Prt formula is, indeed, for simple interest. The banks claim theirs is also simple interest, but.... The correct formula for their payment calculation is:
<i>
</i>payment=Principle*r/(1-(1+r)^(-n))

where r is the monthly interest rate (the APR/12) and n is the number of months. Or r is weekly/bi-weekly/twice-monthly (APR/52 or APR/26 or APR/24) and n is the number of such payments.

I just looked for the rules about posting links and can't find them, so I'll probably get in trouble for this:
<i>
</i>http://spruce.flint.umich.edu/~jalarie/jaa_kcg.htm
http://spruce.flint.umich.edu/~jalarie/jaa_kcg1.htm
http://spruce.flint.umich.edu/~jalarie/jaa_kcg2.htm
http://spruce.flint.umich.edu/~jalarie/jaa_kcg3.htm
http://spruce.flint.umich.edu/~jalarie/jaa_kcg4.htm
http://spruce.flint.umich.edu/~jalarie/jaa_kcg5.htm
Copy linkTweet thisAlerts:
@andy1212authorFeb 27.2011 — Thanks for your help, I'll look at those links also.
×

Success!

Help @andy1212 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...