Math formula with Precision

Rather than converting the time to a true time value decimal format,you could make your own and just assign a number, such as 0.01, 0.02, 0.03, 0.04, etc (9:00am, 9:15am, 9:30am, 9:45am) from the time choice component. Then assign values to the duration such a 0.01, 0.02, 0.03, 0.04 (15, 30, 45, 60 minutes). Then add the values together along with the date value figured in the sheet. This would eliminate any rounding issues by simplifying the decimal. So for example, selecting 9:15am would give you 0.02. Then selecting a 45 minute duration would give you 0.03. Add them together and you get the result of 0.05, which would be the equivalent of 10:00am for the end time of the duration. This wouldn’t really work if the duration extended past midnight, but I’m sure you could build in a few If statements to handle that. This wouldn’t solve the problem of obtaining the date value for a date, but hopefully by the time the user selects the duration, that value has already been calculated and returned from the sheet.

2 Likes

That’s similar to what I actually did. Using the new choice value versus display feature I have my time choice component displaying my 15 minute intervals but it’s actually writing the time value to the sheet. Your solution is a lot craftier though!

3 Likes

Interesting concept now that I think about it, Jeff. I’ll need to play with this tomorrow. Honestly, it would be nice if we could just have a “no precision” option or one with 5 decimal places. Should be rather easy, I’d think…right @Mark?

@Jeff…you’re a flippin’ genius.

Bypassed the rounding/truncating nonsense by employing your .01 etc. method and it works like a charm! Take a look:

3 Likes

Yes, Jeff’s was a genius idea. Thank you so much @Jeff_Hager.

@Robert_Petitto
What did you to check the availability when the proposed meeting rolls over to the next day?

I am not implementing Jeff’s idea yet because I know I am going to be stuck in the above scenario.

1 Like

That scenario never happens in my app…my booking times are 7:30-4:00. I’ll have to test.

1 Like

Robert, Here is my workaround. Nothing amazing but manages time conflict. I wrapped the time inside the Table reservation By calculating the seating by per head, duration, and time taken to clear the tables on 7 hour opening day. It’s nothing compared to what you guys have produced, but works for restaurants, I think. Guess whose booking app was my inspiration. Jeff as ever !

2 Likes

Ya, I think that would work just fine for a restaurant. Nicely done.

1 Like

In all honesty, it was a collaborative effort including @Robert_Petitto, @kyleheney and several others to get to this point.

2 Likes