Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Help with rounding numbers

Hello
I was wondering if anyone could help me to round down a number that is the result of an equation. The current equation Im using is

DateDiff("H", tme, ltme)

But when the equation is executed if; say the result is 2.788 it will round to 3, now i was wondering if someone could give me a code that would make the result round down; i.e 2.788 will display as just 2.
Any Help would be great, Thanks!
[427 byte] By [Mister Purple] at [2007-11-11 10:13:37]
# 1 Re: Help with rounding numbers
Take a look at VB's Fix function.
Phil Weber at 2007-11-11 17:22:54 >
# 2 Re: Help with rounding numbers
That is strange, because DateDiff returns a Long, not a Double...

use Minute instead of hours, and divide the result by 60 using integer divide \ instead of /
mstraf at 2007-11-11 17:23:54 >
# 3 Re: Help with rounding numbers
if you could post the values of variables tme and ltme then it would hep us to analyse better..
ganeshmoorthy at 2007-11-11 17:24:55 >
# 4 Re: Help with rounding numbers
...for more info than you 'll ever need about rounding:

http://support.microsoft.com/kb/196652/EN-US/#XSLTH3170121122120121120120
Sigid at 2007-11-11 17:26:00 >
# 5 Re: Help with rounding numbers
If you want to 'round down', then use Int(x)
gupex at 2007-11-11 17:26:59 >