Checking numer type

Hello
Is there any quick way to verify if a passed number is integer or not ? I’d love something like Isinteger() but it doesnt exist, so I was wondering if you know any workarounds, thanks

rgds

Assuming you have a Variant and you want to know if it is an Integer or Double:

If var.Type = Variant.TypeDouble Then ...

[quote=289947:@Eli Ott]Assuming you have a Variant and you want to know if it is an Integer or Double:

If var.Type = Variant.TypeDouble Then ...[/quote]

Nice, Eli! Am i right when i say that if it’s not a Variant, Horacio could assign the Value to a Variant and then perform the above Test?

Thanks I found an alternative way:
If a number X is sumultanoisly both ceil and floor then it must be integer.

I hope there are not exceptions. So far it works

Thanks anyways

Yes (note that this is different AFAIK as with Auto).

[quote=289963:@Horacio Vilches]Thanks I found an alternative way:
If a number X is sumultanoisly both ceil and floor then it must be integer.

I hope there are not exceptions. So far it works

Thanks anyways[/quote]

That will tell you if it contains an Integer VALUE, but NOT if the variable TYPE is integer

and you don’t need to check BOTH…

If X=floor(x) then its an integer value
if X=ceil(x) then its an integer value