ASP - asp convert string to number - Asked By Fouad Romieh on 13-Dec-06 07:33 AM

Hi

I have the string 12 for example and i need to convert it to integer is it possible and how?

Number(string var) should do! - sundar k replied to Fouad Romieh on 13-Dec-06 08:26 AM

end of post

Introduction to Data Types and Data Type Conversion (Article) - Senthil T. replied to Fouad Romieh on 13-Dec-06 08:43 AM

Refer the link

http://www.freevbcode.com/ShowCode.asp?ID=3833
Sushila Patel replied to Fouad Romieh on 13-Dec-06 09:16 AM
Use CInt(expression)
use CInt or CLng or CSng - mv ark replied to Fouad Romieh on 13-Dec-06 09:17 AM
Depending on the number, use CInt or CLng  or CSng    

Ex:
strVar = "123"
If isNumeric(strVar) Then
  lngVar=cLng(strVar)
End If

CInt      Converts an expression to a variant of subtype Integer
CLng     Converts an expression to a variant of subtype Long
CSng     Converts an expression to a variant of subtype Single


Use Cint() - Umesh Gaikwad replied to Fouad Romieh on 27-Dec-06 12:39 AM

you can use Cint to convert from string to integer.

Cint(variablename)