Decimal Places

  • Thread starter Thread starter Glenna
  • Start date Start date
G

Glenna

Why does access put 4 decimal places on a calculation? I have it set to
currency and zero or 2 decimal places but it still does it. I have tried
fixed also. The calculation is basically the same as if I did it in excel
but for some reason it always puts the 4 decimal places. I need to explain
it to my boss and don't know why it does it. So far it hasn't effected our
data.
 
Why does access put 4 decimal places on a calculation? I have it set to
currency and zero or 2 decimal places but it still does it. I have tried
fixed also. The calculation is basically the same as if I did it in excel
but for some reason it always puts the 4 decimal places. I need to explain
it to my boss and don't know why it does it. So far it hasn't effected our
data.

A Currency datatype is a scaled huge integer with exactly four, no more, no
fewer, decimal places. The Decimal Places property on the field just controls
the display, not what's stored.

If you wish to keep it to two, explicitly round the value in the calculation:
e.g.

FullPrice = Round([UnitPrice]*[TaxRate], 2)

This will store it as 32.5400 (rather than 32.5425 say), and you can set the
Format of the form or report control to hide the last two zeroes.
 
Back
Top