Currency

  • Thread starter Formula in Report
  • Start date
F

Formula in Report

I am using Access 2003.
In my database, Form view, I have a currency field set to 5 decimal points.
I can enter 5 decimals ( ex: .16598) but it automatically rounds it up to
..16600. How can I keep this field from rounding up?

I would appreciate any help you can give me!
Aurora
 
J

Jeff Boyce

Aurora

Access offers a Currency data type, but it only holds 4 places, max.

Is there a specific reason you need 5 places?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
F

Formula in Report

Thank you for responding. We sell some of our products in the thousands. We
have a couple of customers who want to see the individual piece price - in 5
decimal form. Is there anyway to "fool" "mother Access" to get 5 places to
show? If it doesn't show, does it still use the 5 digits in a calculation or
does it use the rounded up number for calculating? Thank you for your help.

Aurora
 
J

Jeff Boyce

Aurora

If you are using the Currency datatype, it stores 4 places. Period.

If you'll need more than four (stored and for calculations), take a look at
Single (but watch out!). If I recall correctly, Single (and Double) store
numbers in binary, which leads to strange results like (3.99999 <> 4.0),
even though 4.0 was stored in both places!

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

John W. Vinson

Thank you for responding. We sell some of our products in the thousands. We
have a couple of customers who want to see the individual piece price - in 5
decimal form. Is there anyway to "fool" "mother Access" to get 5 places to
show? If it doesn't show, does it still use the 5 digits in a calculation or
does it use the rounded up number for calculating? Thank you for your help.

You can convert the value to Double or Decimal in the calculation:

UnitPrice: CDbl([PerThousandPrice]) / 1000.

That will give you up to 14 decimal places; you can use

Round(CDbl([PerThousandPrice) / 1000., 5)

to round it to five decimals.
 

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