Rounding up in Access

G

Guest

I need to round a value up if it slightly goes over a whole number eg 2.01 to
2.49 needs to be rounded up to 3 anybody got any ideas - Thanks
 
J

James A. Fortune

LGC said:
...and if the precision is greater than .01 you can use:

Abs(Int(-(OriginalNumber)))

-LGC
....and if the values can also be negative you can use:

Public Function Ceiling(dblX As Double) As Long
Ceiling = Int(dblX) + Abs(dblX > Int(dblX))
End Function

e.g.,

2.001 ==> 3
2 ==> 2
0 ==> 0
-1.5 ==> -1
-2 ==> -2

-JAF
 

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

Rounding up! 2
Round Up a Decimal 6
Currency Data - rounding error ? 3
Access Round() Function Question 5
rounding problem 7
Rounding 10
Rounding 2
Round number subject to it's value 1

Top