Hi folks.
I am looping through a text file, accumulating a certain value on each record into a variable defined as Single. The values are quite low, but to 2 decimal places.
Can anyone explain why when I say sngAmount = sngAmount + csng(strAmount) it manages to add 61.85 to 18.30 and come up with 80.14999?
I have read a wonderful comment in another post that says "if you are dealing with EXACT numbers, don't use single or double" which seems totally ludicrous to me. Surely numbers are, by their very nature, exact.
Is there a simple get-round? Access 2003.
I am looping through a text file, accumulating a certain value on each record into a variable defined as Single. The values are quite low, but to 2 decimal places.
Can anyone explain why when I say sngAmount = sngAmount + csng(strAmount) it manages to add 61.85 to 18.30 and come up with 80.14999?
I have read a wonderful comment in another post that says "if you are dealing with EXACT numbers, don't use single or double" which seems totally ludicrous to me. Surely numbers are, by their very nature, exact.
Is there a simple get-round? Access 2003.