Rounding up

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

Guest

Hello all,

I done some searching on rounding up, but none seem to be what I am looking
for.

Here’s what I need to do.


If myTotal field is greater > then 40, divided / by 30 then round up to
nearest dollar.

Example:

myTotal = 43
Divide by 30 = 1.433333333
Round up to nearest dollar = 2


I have been trying something like this (below), but the result is 1, how do
I get it to round up?

FYI:
I have > 40 on the criteria of the myTotal field.

Results: Int([myTotal]/30*1)/1
 
- Int (- 40/30) = 2

- Int(40/30 * -1) = 2

This works well with positive numbers
 
Mr Dinh,

Thank you very much. From my searches on rounding I see you are a rounding
guru. Have a good day!

Van T. Dinh said:
- Int( - MyTotal / 30 )

--
HTH
Van T. Dinh
MVP (Access)



Mark said:
Hello all,

I done some searching on rounding up, but none seem to be what I am
looking
for.

Here's what I need to do.


If myTotal field is greater > then 40, divided / by 30 then round up to
nearest dollar.

Example:

myTotal = 43
Divide by 30 = 1.433333333
Round up to nearest dollar = 2


I have been trying something like this (below), but the result is 1, how
do
I get it to round up?

FYI:
I have > 40 on the criteria of the myTotal field.

Results: Int([myTotal]/30*1)/1
 
I like the other solutions better, but here is another just for grins:

= 40\30 + iif( 40 mod 30 > 0, 1, 0)
 
Back
Top