But ....
(CStr(123.4).Length <= 5) = True
but 123.45 is not integral.
Also, if you use (_num = Int(_num)) then you will run into rounding issues
on various numeric values.
In my opinion it is best to use the Fix method:
If Fix(_num) = _num Then
' _num is integral
If _num <= 99999 Then
' _num is in range
End If
End If
or
If Fix(_num) = _num AndAlso _num <= 99999 Then
' _num is integral and it is in range
End If
"andreas" <an*****@pandora.be> wrote in message
news:dR***********************@phobos.telenet-ops.be...
Yes, I think that the code helps
f.e. I want to know of NumberD^0.3 is integral
This is true as cstr(NUmberD^0.3).lenght <= 5 (I know that NumberD
<=99999,999999999)
Don't you agree?
Thanks for your answer
"Cyril Gupta" <no****@nospam.com> wrote in message
news:u6**************@TK2MSFTNGP05.phx.gbl... I am sorry, but I can't see how this code helps. This will merely tell
you
whether the number is less than 5 characters long... mm.. How does it
help
you find that the number has no fractions?
Maybe you can simply use this
if mynum = int(mynum) then
my number is integral
hmm.. i hope i didn't understand what you wanted to do..