Check to see if a value is an integer!

# Thread: Check to see if a value is an integer!

1. Senior Member
Join Date
Dec 1969
Posts
590

## Check to see if a value is an integer!

Hi-<BR><BR>Is there any built in ASP function that returns true if a value is an integer or false if a value is not an integer? Thanks in advance..<BR><BR>Nick

2. Steve Cimino Guest

## RE: Check to see if a value is an integer!

IsNumeric will differentiate between numbers and text.<BR><BR>Or are you trying to see if you want an INTEGER, and not include floating numbers?

3. Senior Member
Join Date
Dec 1969
Posts
590

## RE: Check to see if a value is an integer!

Well I really need to see if it is an integer or not - floating point numbers won&#039;t be allowed..

4. New ASP Guest

## RE: Check to see if a value is an integer!

&nbsp;<BR>DIM the_type<BR><BR>....<BR><BR>the_type = vartype(your_var)<BR><BR>the_type = 2 &#060;-- A INT<BR>the_type = 8 &#060;-- A String<BR>

5. Steve Cimino Guest

## RE: Check to see if a value is an integer!

If IsNumeric(yourvar) AND InStr(CStr(yourvar),".") = 0 Then<BR>&#039;you know it&#039;s an integer

6. New ASP Guest

## RE: Check to see if a value is an integer!

the_type = VARTYPE(your_var)<BR><BR>Return Values<BR><BR>The VarType function returns the following values:<BR><BR>vbEmpty 0 Empty (uninitialized) <BR>vbNull 1 Null (no valid data) <BR>vbInteger 2 Integer <BR>vbLong 3 Long integer <BR>vbSingle 4 Single-precision floating-point number <BR>vbDouble 5 Double-precision floating-point number <BR>vbCurrency 6 Currency <BR>vbDate 7 Date <BR>vbString 8 String <BR>vbObject 9 Automation object <BR>vbError 10 Error <BR>vbBoolean 11 Boolean <BR>vbVariant 12 Variant (used only with arrays of Variants) <BR>vbDataObject 13 A data-access object <BR>vbByte 17 Byte <BR>vbArray 8192 Array <BR><BR>HTH<BR><BR>

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•