How round number to one dec place ???

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have numbers like

1.666
2.333

that I need to display in my report a

1.
2.

I looked in Access help to no avail!
 
If you have Access 2000 or newer, there is a built in rounding function, but
it does "banker's" rounding. It will round 0.5 to the nearest even number
instead of rounding up. The formula to round a number, always rounding .5
upward (actually to geater Absolute Value), if you want to create your own
function is

Int(Number * 10^-(Place) + 0.5) / 10^-(Place)

To round to the 10ths position, the Place would be -1, so 10^-(-1) is 10,
yeilding

Int(Number * 10 + 0.5) /10

The Abs comment is because this will round -1.6666 to -1.7. If you want it
rounded to -1.6, then use Fix instead of Int. Positive numbers won't be
affected.

For Place:
100ths = -2
10ths = -1
1s = 0
10s = 1
100s = 2
etc.
 
Back
Top