# Math Column: Date & Time Duration to Decimal

**URL:** https://community.glideapps.com/t/math-column-date-time-duration-to-decimal/40280
**Category:** Ask for Help
**Created:** [March 31, 2022, 2:01am UTC](https://community.glideapps.com/t/math-column-date-time-duration-to-decimal/40280 "2022-03-31T02:01:00Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![AjBruce](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ajbruce/32/12937_2.png) [@AjBruce](https://community.glideapps.com/u/AjBruce)
#### Post date: [March 31, 2022, 2:01am UTC](https://community.glideapps.com/t/math-column-date-time-duration-to-decimal/40280/1 "2022-03-31T02:01:00Z")

</div>

I am using a Timesheet template @Robert_Petitto that uses a _math column_ that subtracts Time Out and Time In (out-in)\*24 to generate a time duration.

**When first used, the display shows an average that is rounded to the nearest Ones.**

 ![displayRawHours1](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/7/37b8207edf1922572c870848a921e5a0e73a1bad.png)  
 ![displayRawHours2](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/7/3700b5097ef0fc324cd713c0e8ad22de95e0ce29.png)

**Following a few adjustments to the configuration, now the column displays the calculated duration for which is not the display I am seeking.**

 ![displayRawHours3](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/e/def7111d98c2a91761b0c20375a583eedbd87f87.png)

**I have noticed that when clicking into the cell that it shows the decimal value of what is required to display within the chart.** Example: .00172383333 not 24:49

 ![displayRawHours4](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/4/f4fd78bff2fa534c1f704bb966185b8b28c2a8f2.png)

**The objective is to display the duration in decimal.**

 ![displayRawHours5](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/0/70a3745afd493c518276982398b4a2fb24c4acd0.png)

@Robert_Petitto says that the displays are using the trunc() function, but I just can’t seem to get it working.

Please advise.

Data Editor

> Column Type \> Math  
> Configuration: (out-in)\*24  
> Replacements \> DateTime In and DateTime Out

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [March 31, 2022, 3:30am UTC](https://community.glideapps.com/t/math-column-date-time-duration-to-decimal/40280/2 "2022-03-31T03:30:02Z")

</div>

This is a recent development on the math column that it now automatically returns a duration format if you do calculation based on a date/time input.

You can use something like this to get a number.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/a/1a6817fbd3646e78b4deba977b4d76f3c5b4f673.png)

In this example I’m using rounding to 2 decimals.

---

<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: [March 31, 2022, 11:33am UTC](https://community.glideapps.com/t/math-column-date-time-duration-to-decimal/40280/3 "2022-03-31T11:33:14Z")

</div>

Right…:you can wrap the equation in either a trunc() or a round() function.

---

<div class="post-metadata">

### Author: ![DanielNice](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/danielnice/32/63330_2.png) [@DanielNice](https://community.glideapps.com/u/DanielNice)
#### Post date: [September 7, 2023, 4:09am UTC](https://community.glideapps.com/t/math-column-date-time-duration-to-decimal/40280/4 "2023-09-07T04:09:48Z")

</div>

Thank you for this
