Click to See Complete Forum and Search --> : Converting a string to a variable...


AdamBrill
12-21-2002, 04:22 PM
I have a string that contains the value 200. What I want to do is get the data into a variable so that I can add, subtract, etc. Is there any way to do that? Thx. Adam

gil davis
12-21-2002, 04:44 PM
var st = "200";
var nm = Number(st); // or Number("200");
// you could also use parseInt() or parseFloat()

AdamBrill
12-21-2002, 05:13 PM
Thanks... I figured there was an easy way to do it, but I didn't know what it was.. ;)