Larry, your code will work only the if it is possible to convert the number into a long. With big numbers the statement CLng(fVal) will thrown an error (this is why I used Fix instead of CLng)
BTW the line
bIsWholeNumber = IIf(lVal = fVal, True, False)
could be written simply (and faster) as
bIsWholeNumber = (lVal = fVal)
(well, I hate the IIF... it is so moronic)
Marco
|