how do I prevent rounding of numbers?

C

Crabbytree

I have a field that takes a value linked to a description and is supposed to
multiply by the quantity. The related field holding the value rounds to an
even dollar, sometimes up and sometimes down! All the end values are whole
dollars. Why is the data getting rounded?
 
J

John Vinson

I have a field that takes a value linked to a description and is supposed to
multiply by the quantity. The related field holding the value rounds to an
even dollar, sometimes up and sometimes down! All the end values are whole
dollars. Why is the data getting rounded?

Probably because you have used the default Number datatype, Long
Integer. Integers are, by definition, whole numbers.

If you're handling money data, use a Currency datatype rather than a
Number datatype. It gives you exactly four decimal places, no more no
fewer - so if you're calculating a tax, you should use the Round()
function to round to two decimals.

John W. Vinson[MVP]
 
T

tina

check the value field's Data Type in the table's design view. if it's Long
Integer, Integer, or Byte, try changing it to Double.

hth
 
J

John Vinson

check the value field's Data Type in the table's design view. if it's Long
Integer, Integer, or Byte, try changing it to Double.

.... or to avoid roundoff error, using a Currency datatype rather than
Number.

John W. Vinson[MVP]
 

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