PDA

View Full Version : How do I get js to treat a variable as a number?


Garadon
09-30-2002, 09:55 AM
as title say :D having a small memory loss here lol:cool:

Chris Poole
09-30-2002, 11:37 AM
var num = 36 // treated as a number
var num = '36' // treated as a string

whammy
09-30-2002, 12:18 PM
http://www.codingforums.com/showthread.php?s=&threadid=7023

should help you out...

P.S. Not trying to be mean, but you should also read the very first post which says "Must read: MUST READ- How to post a JavaScript question!" (especially the part pertaining to using the search feature):

http://www.codingforums.com/showthread.php?s=&threadid=2090

:)