Calc minutes

Support for our integrated Contact Manager, Calendar, and Project Tracker.
Posts: 18
Joined: Sun Dec 12, 2010 11:17 pm
PostPosted: Wed Jan 26, 2011 5:20 am
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.
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Wed Jan 26, 2011 7:31 am
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 )

)
John Sindelar
SeedCode
Posts: 18
Joined: Sun Dec 12, 2010 11:17 pm
PostPosted: Thu Jan 27, 2011 10:49 pm
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.

Return to SeedCode Calendar

Who is online

Users browsing this forum: No registered users and 2 guests

(855) SEEDCODE
[email protected]
Follow us: