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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert string to integer

Status
Not open for further replies.

KyoAD

Technical User
Aug 5, 2002
106
SG
Hi all,

Just wondering if there is any function or way to convert a string to an integer? I cant seem to find any function. For example, i want to convert string "02" to an integer '02'

Thanks in advance!

 
Hello KyoAD,

Here a lead.
Code:
s="123"
wscript.echo s & vbtab & IsNumeric(s)  & vbtab & (s + s)
n=cint(s)
wscript.echo n & vbtab & IsNumeric(n)  & vbtab & (n + n)
note: how strange isnumeric() is?

regards - tsuji

ps Should you not look up the documentation yourself for your own good?
 
Take a look at CInt,CLng,CSng,CDbl,CDec,CCur.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top