is there any is integer function ?

  • Thread starter Thread starter Tee
  • Start date Start date
And how would this know the difference between 1 and 1.1?

if x > 0 AND x = CTYPE(x, Integer) then
 
Hi,

Thanks for your reply,
I know about the isnumeric, but ... whatever number value will return true
with isnumeric, so I hope to get something like isInteger() ...

thanks.
Tee
 
Hi,

As noted before, for a positive integer, you can just say:
if(x > 0)
To test whether x is in integer, you can say:
x = int.Parse(value.ToString())
where value is the number you want to check.

If value represents an integer, x will contain it after
the step given above. Else an FormatException will be
thrown.

For more details you can check out int.Parse in MSDN.

HTH
Regards
Harsh Thakur
 
with isnumeric, so I hope to get something like isInteger() ...

You need to re-read Scott's reply. That was the first thing he tested for.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Back
Top