____  _ ____ ____ ______ ____  
|___ \| |___ \___ \____  |___ \ 
  __) | | __) |__) |  / /  __) |
 |__ <| ||__ <|__ <  / /  |__ < 
 ___) | |___) |__) |/ /   ___) |
|____/|_|____/____//_/   |____/ 
      

i pwn all thats all u need to know.

Friday, August 24, 2007

//Convert a String Variable into an Integer or Numbers/Numeric’s

This sniplit converts variables into numeric’s allowing you to interact with them in that maner (adding subtracting etc).


//code

//vars
var myInt1="35";
var myInt2="35";
var varX;
//parseInt convert
myInt1=parseInt(myInt1);
myInt2=parseInt(myInt2);
//add vars
varX=myInt1+myInt2;
trace('varX: '+varX);
//end
//outputs: varX: 70

//more
http://3l3373.com/blogz0r/2007/08/xml-variable-string-to-numeric.html

Labels: , , , , ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home