Decimals wrong

J

Jose Perdigao

I have a field in a table as single and the results is to 3 decimals for all
records, for examploe 2.469.
When I use a query and I sum this field the result come to 2.49600005149841.
Why?
I didn't like to use around to 3 decimals because the inicisal figure is
ready to decimals, I think, the result should be 2.496 and not
2.49600005149841.

This is a mistake for access?
How can resolve this problem?

Thanks
José Perdigão
 
T

Tom Ellison

Dear Jose:

A single datatype stores values that are scientific or engineering in
nature - measurements. It does not store them in exact ways as you would
want to store accounting information, but the range with exponentiation
allows huge values and tiny values to be stored.

If you were writing a scientific or engineering application, the tiny
discrepancies would not bother you. However, the limitations of those
datatypes that are designed for accounting might bother you a great deal.

If you're writing an accounting application, where the numbers are money,
then it's the other way around.

There's nothing wrong with Access here. Choosing appropriate datatypes is
the problem. It's a tradeoff, and it looks like you've picked the wrong
alternative. This is not uncommon.

For accounting applications, always pick the money datatype, even if you're
recording weights or miles or other ordinary measures. Save the singles and
doubles for physicists, engineers, and land surveyors.

Tom Ellison
 
Top