Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 8069 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I am trying to figure out the calc that would round a time field to the nearest quarter hour.

IE: 10:00 thru 10:14 = 10:00 or 7:45 thru 7:59 = 7:45

Posted

OK, take a look at the attached FMP 5/5.5/6.0 file... it looks at the minutes, rounds them down to the nearest quarter hour, then converts it back to time again.

time round.fp5.zip

Posted

Heck, don't bother with the attachment. Here is an even simpler and more elegant version of the calculation:

--

Time( Hour(time),

Case(Minute(time) >= 0 and Minute(time) <= 14, 0,

Minute(time) >= 15 and Minute(time) <= 29, 15,

Minute(time) >= 30 and Minute(time) <= 44, 30,

Minute(time) >= 45 and Minute(time) <= 59, 45),

0 )

--

Posted

Or even shorter...

Time(Hour(time), 15 * Int(Minutes(time) / 15))

You can use that to round down to 10's or 30's or whatever... just change the two numbers.

Posted

If you look at the Handy Bits file (RussCalcs from Oz.fp5) in the samples section of the forum, there is an option in the time tab which will round hours to a selected fraction. So, the user can select time to be rounded either up or down to the nearest o.xx of an hour.

This topic is 8069 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.