# Math formula with Precision

**URL:** <https://community.glideapps.com/t/math-formula-with-precision/9208>\
**Category:** Report a Bug\
**Created:** [May 15, 2020, 5:48pm UTC](https://community.glideapps.com/t/math-formula-with-precision/9208 "2020-05-15T17:48:13Z")\
**Posts on this page:** 9\
**Page:** 2

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [May 16, 2020, 6:41pm UTC](https://community.glideapps.com/t/math-formula-with-precision/9208/21 "2020-05-16T18:41:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [May 16, 2020, 7:02pm UTC](https://community.glideapps.com/t/math-formula-with-precision/9208/22 "2020-05-16T19:02:15Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [May 18, 2020, 2:51am UTC](https://community.glideapps.com/t/math-formula-with-precision/9208/23 "2020-05-18T02:51:36Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [May 18, 2020, 12:46pm UTC](https://community.glideapps.com/t/math-formula-with-precision/9208/25 "2020-05-18T12:46:39Z")

</div>

@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:

---

<div class="post-metadata">

**Author:** ![sardamit](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sardamit/32/263_2.png) [@sardamit](https://community.glideapps.com/u/sardamit)\
**Post date:** [May 18, 2020, 1:06pm UTC](https://community.glideapps.com/t/math-formula-with-precision/9208/26 "2020-05-18T13:06:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [May 18, 2020, 1:24pm UTC](https://community.glideapps.com/t/math-formula-with-precision/9208/27 "2020-05-18T13:24:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Wiz.Wazeer](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/wiz.wazeer/32/72423_2.png) [@Wiz.Wazeer](https://community.glideapps.com/u/Wiz.Wazeer)\
**Post date:** [May 19, 2020, 2:37am UTC](https://community.glideapps.com/t/math-formula-with-precision/9208/28 "2020-05-19T02:37:43Z")

</div>

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 !

> **[Restaurant Booking Form](https://restbookingform.glideapp.io/)**
>
> A simple hospitality booking form that takes care of time conflict, and requires no third-party integration. Glide pure & simple!

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [May 19, 2020, 2:39am UTC](https://community.glideapps.com/t/math-formula-with-precision/9208/29 "2020-05-19T02:39:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [May 19, 2020, 3:13am UTC](https://community.glideapps.com/t/math-formula-with-precision/9208/30 "2020-05-19T03:13:31Z")

</div>

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

> [@Room Booking that prevents conflicts](https://community.glideapps.com/t/room-booking-that-prevents-conflicts/4288):
>
> I’m starting to work on a room booking app and was wondering if anyone has figured out a good way to create a way to prevent conflicting days/times (so that if I book a meeting on Monday from 9-10AM, this time slot can’t be booked by someone else). I know I could create a choice component that lists the possible days/times and then can probably figure out a way to remove choices as they are taken, but this doesn’t take into account all possible time choices (sometimes people will book on the 15…

[Previous page](https://community.glideapps.com/t/math-formula-with-precision/9208.md?page=1)
