I am getting small math errors when I use a query to convert a column's
data type from Text to Single. I am using a calculated column with the
following expression.
HighSchoolGPA: IIf(IsNull([GPA]),Null,CSng([GPA]))
When GPA = "3.10", HighSchoolGPA := 3.09999990463257, not 3.1. For this
particular application, the difference between 3.09999990463257 and 3.1
is unacceptable.
A couple of notes: When I evaluate
IIf(IsNull("3.10"),Null,CSng("3.10")) in the immediate window, I get
the correct result of 3.1. Also, the table containing GPA is linked via
ODBC to a SQL Server database.
I can easily workaround the problem by using the Round() function, but
I'd prefer to understand why I'm getting the problem in the first
place. Can anyone offer advice?
-TC