Hi

I have a string array called tokens that has been previously filled. I convert some of the tokens to doubles and add them together, but sometimes it seems to evaluate incorrectly. I have a case where it should evaluate to true, but is evaluating to false for some reason I can't understand. Any ideas on what I'm missing or what I can do to fix this? Last time I checked 2.73+17.51=20.24 was a true statement... Is VBA just retarded!?

VB Code:
  1. 'try the new algorithm to fill the variables
  2.         If ((CDbl(tokens(3)) + CDbl(tokens(5))) = CDbl(tokens(1))) Then
  3.         'Why isn't this evaluating to true on record 8 for 9730 - 7267
  4.         'tokens(3) = 2.73
  5.         'tokens(5) = 17.51
  6.         'tokens(1) = 20.24
  7.             paidToAgency = tokens(1)
  8.             paidToYou = 0
  9.         Else
  10.             'Now try to figure it out based on tabs...
  11.             If (CInt(Mid(tokens(0), 3)) > CInt(Mid(tokens(2), 3))) Then
  12.                 paidToYou = tokens(1)
  13.                 paidToAgency = 0
  14.             Else
  15.                 paidToAgency = tokens(1)
  16.                 paidToYou = 0
  17.                 tableName = "tblBadData"
  18.             End If
  19.         End If

Here is a copy of my immediate window during execution:

Code:
?(CDbl(tokens(3)) + CDbl(tokens(5))) = CDbl(tokens(1))
False
?tokens(3)
2.73
?tokens(5)
17.51
?tokens(1)
20.24
Thanks,
Ranthalion