English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I'm trying to use javascript to calculate monthly payment of a loan with an interest rate of 14.4%.
If you borrow 1000 for 2yrs you should pay abt 48 per month. My formula is however giving 18 instead of 48. When i try with excel it's working fine. Please tell me what is wrong or give me a working code from any other language. Am using asp server.

See the pmt formula at: http://www.1728.com/loanform.htm

Here is my code which you can copy&paste for testing:



principal:

years:



monthly pymt:

2006-08-07 23:29:21 · 2 answers · asked by Justme 2 in Computers & Internet Programming & Design

2 answers

You could use parse float or you could do it just with eval()

Working code:





principal:

years:



monthly pymt:




I had to change a bit of youre html but only because i prefer it laid out like this.

2006-08-08 00:08:49 · answer #1 · answered by Anonymous · 1 0

Use parseFloat( ) to get value from Principal text box.

2006-08-08 06:57:17 · answer #2 · answered by Indian_Male 4 · 0 0

fedest.com, questions and answers