Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why am I losing decimal
Message
 
 
À
13/07/2001 11:39:22
Christian Bellavance
Université du Québec à Hull
Hull, Québec, Canada
Information générale
Forum:
Internet
Catégorie:
Javascript
Divers
Thread ID:
00530310
Message ID:
00531423
Vues:
10
Hi!

value property is of character type, so probbaly lose is during the conversion. Try to convert number manually.

>Hi, why am I losing decimal in that function
>
>function UpdateAmount()
>{
> var tmp;
> var mnt;
>
> myName = "myControlName";
> mnt = parseFloat(document.myForm.myTotalAmount.value);
> mnt = mnt + parseFloat(document.myForm.elements(myName).value);
> document.myForm.myTotalAmount.value = mnt;
>}
>
>The total are calculated correctly but on the web page I lose decimal. Why?
>
>Thanks.
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform