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.
Calc minutes
3 posts
• Page 1 of 1
Posts: 18
Joined: Sun Dec 12, 2010 11:17 pm |
|
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 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 |
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. |
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests