Click to See Complete Forum and Search --> : loan problem with frames2
kwaniam
03-01-2003, 04:31 PM
i fixed the previous problem but now i have two more,1) my outputs are coming out right but are cut off (if the number should be 12,345.67) it is coming out (,345.67) 2) in the output if payment amount and total interest is NaN(not a number) it should say invalid data but it is only working for payment amount not total interest.
Nedals
03-01-2003, 05:44 PM
I did not go through all your code but I did notice that you run the 'initilize()' function twice; once onLoad and then again at the end with some 'javascript'. That could be your problem.
One other note. You can use this for formatting your numbers
formatted_val = unformatted_val.toFixed(decimal_places);
Dan Drillich
03-01-2003, 08:07 PM
As nedals said, you can just replace your code with the following -
//document.results.payment_amount_text.value=formatDecimal(payment_amount);
document.results.payment_amount_text.value=payment_amount.toFixed(2);