...

View Full Version : string to num and num to string how?



ggi111
04-27-2006, 07:05 PM
hi,

string to num and num to string how?

thanks.

ggi111
04-27-2006, 07:41 PM
i mean-i have a variable with a string - "50px" and i want just the 50 in a variable which is no string...

how?
thanks..

nathan_lamothe
04-27-2006, 07:47 PM
parseInt(variable) should strip the 50 from the px for you...

so
if oldvar='50px'

var newvar =parseInt(oldvar);

should work for you.

ggi111
04-29-2006, 02:48 PM
thanks - where can I learn more on this specific function?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum