Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

numeric input

Status
Not open for further replies.

effennel

Technical User
Oct 15, 2002
60
CA
Simple problem:

i am having 2 input boxes (variables X and Y), one dynamic output (variable Z), and one submit button. i want to create a simple addition.

Let's pretend X=5 and Y=4. When i use the "+", insted of getting Z=9, i get Z=54. When i use the multiplication "*" i get the correct answer. I suppose that flash interprets the X and Y as text even if it is numbers. How can i force these variables to be numeric. i want a 9!!!

Thanks
fnl
 
z= Number(x) + Number(y);

Or...

z=parseInt(x,10) + parseInt(y,10); Regards,

oldman3.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top