format a number

wxdqz

New Member
Hi,

I'm exploring java and want to try some things. I'm stuck with the following problem:
I'm picking up formvalues to a function which calculates numbers, currency that is and (wich I was born in the USA) it happens to be Euro's with a comma as decimal separator.
The values from two field have to be summarized with a maximum of 2 numbers after the comma.
I'm using this function:

function newtotal()
{document.TELFORM.TOTAL.value=
parseInt(document.TELFORM.PR_BE.value,10)+
parseInt(document.TELFORM.PR_MO.value,10)}

When I fill the fields in my form with numbers like
11,23 and 22,07 I get 33 as a result.

Furthermore I noticed that when I put a in value greater than 1000,00 (looks like 1.007,45 the sum becomes 1 of the total field.

Can somebody give me a hand?
 
Back
Top