Decimal Places


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.
 
Ad

Advertisements

J

John W. Vinson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top