Thread: Strange problem
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Stuart[_8_] Stuart[_8_] is offline
external usenet poster
 
Posts: 5
Default Strange problem

I have used the following block of code to try and detect any number that is
more than two decimal places in length, unfortunately I am getting strange
results, occasionally it is throwing out numbers that are correct. the
differance being a very small amount such as 1.42145*10^-14

Why is it doing this?....and is there a more reliable way of detecting
numbers over two decimal places in length?


For Each num In Selection
If Int(num * 100) - (num * 100) < 0 Then
MsgBox "More then two decimal places....."
MsgBox Int(num * 100) - (num * 100)
End If
Next num