How do I stop my number fields to round up?

G

Guest

I have these number fields that keep rounding up in my database. Is there a
way for it to not round up? For example, if my data is 18.688, I want it to
stay at 18.68, but it's rounding it to 18.69. Can it do this?
 
J

Jeff Boyce

The rule (OK, one rule) for rounding is that a value of "5" or greater
rounds up. From your example, 18.688, the last place is "8" (>=5), so the
next highest decimal place rounds up, and you get 18.69 ...

If you want to chop off the third decimal value and just use the first two
places, consider truncating the string (you could treat it as a string of
characters and display all but the last character).

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

It would appear it is an issue with data typing and formatting. If you
define your field as Number, Double, and set Digits to Auto, you should not
have this problem.
 
G

Guest

Thanks for helping me out.

I'm having trouble with calculated fields. The 18.688 is 10% of another
number field. We're trying to calculate the penalties and interests of
taxpayers who have gone delinquent with their taxes and instead of rounding
up the numbers the correct way, we just want to have 2 decimal places,
without the rounding.

Jeff mentioned about truncating. Would you be able to help me with that? I
just want to "grab" the 2 decimal places of the calculated fields without it
rounding.

Thanks again.
 
G

Guest

Okay, Here is a formula that will trunctate to two digits regardless of how
many digits are on either side of the decimal:
Result = Left(Penalty, InStr(Penalty, ".") + 2)
 

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

Similar Threads


Top