Is it an integer

From HashVB
Revision as of 01:32, 30 August 2005 by Dee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

So, you want to tell if a number is an integer?

VB has a very useful function called Int() that will give you the integer portion of a number. You can then compare this to the original, and if they match, it is an integer.

Function IsInteger(byval Value) as Boolean
  IsInteger = (Int(Value) = Value)
End Function

Simple as that.