Page 1 of 1

Calc minutes

PostPosted: Wed Jan 26, 2011 5:20 am
by MiltonTrickey
Hi All

I am trying to convert numbers that are entered for hours worked: The user enters say 6.25 where the 6 is for hours and the 25 is for minutes and I would like to convert the minutes into a fraction of 100
i.e. 15 minutes is really .25 of an hour, 10 minutes is really .165 of an hour etc

Thanks again

Milton.

Re: Calc minutes

PostPosted: Wed Jan 26, 2011 7:31 am
by John Sindelar
I'd say 10 minutes is .167 of an hour, so the following calc rounds this to 3 decimal places. You can change that, of course.

Hope it helps:

Let ( n = YourField ;

Int ( n ) +

Round ( ( mod ( n ; 1 ) * 100 ) / 60 ; 3 )

)

Re: Calc minutes

PostPosted: Thu Jan 27, 2011 10:49 pm
by MiltonTrickey
Thanks John,

I tried that and couldn't get it to work and after playing around with it, this seems to do the trick.

Round ((Mod(Self;1)*100)/60;3) + Int(Self)

Cheers


Milton.