How do I stop my number fields to round up?

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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
 
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.
 
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.
 
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)
 
Back
Top