rounding down

Chimp8471

Registered User.
Local time
Today, 23:44
Joined
Mar 18, 2003
Messages
353
I have created a report which i am quite happy with, however whenit runs the calculation that i have via a text box

=[SumOfRunTime]/[SumOfOccurances]

displays 683.333333

i need it to just display 683, how can i do this please

Cheers

Andy
 
=CInt([SumOfRunTime]/[SumOfOccurances])
 
once again

Thank you
 
To get it to round to the nearest whole number try
=CInt(([SumOfRunTime]/[SumOfOccurances]) + 0.5)
 
CInt rounds to the nearest whole number for you.

The only problem is when you have a value such as 0.5 which CInt() rounds to 0 rather than the preferred 1.
 
if ([SumOfRunTime]/[SumOfOccurances]) produces a number like 333.8, by adding 0.5 to it (= 334.3) and then CINTing it you get 334 which I think is how my parentheses work.
 
I know - not disputing. Just adding more information. :cool:
 
Why not just use Int()?

Captain Chaos, your formula, adding .5, rounds up to the nearest number. The original poster asked for his result to be rounded down. Your formula would result in 684, the user wanted 683.
 
I agree, why not use Int? I was continueing the thread but why use 3 letters when 4 will do?
Using my formula of adding .5 to 683.333 would give you 683.833 which should INT to 683.
 
I was just wondering if Int() might be faster than CInt(). I would guess that type conversion functions are slower. :D
 

Users who are viewing this thread

Back
Top Bottom