# TRUNC function in Math column or send results to sheet?

**URL:** <https://community.glideapps.com/t/trunc-function-in-math-column-or-send-results-to-sheet/14863>\
**Category:** Feature Requests\
**Created:** [August 28, 2020, 4:48am UTC](https://community.glideapps.com/t/trunc-function-in-math-column-or-send-results-to-sheet/14863 "2020-08-28T04:48:12Z")\
**Posts on this page:** 1\
**Showing post:** 9

<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:** [August 28, 2020, 1:15pm UTC](https://community.glideapps.com/t/trunc-function-in-math-column-or-send-results-to-sheet/14863/9 "2020-08-28T13:15:25Z")

</div>

Nice work @ThinhDinh . I knew there had to be a roundabout way. I had to do something similar awhile back, but a different scenario. In my case 2 values were joined together to form a number with a decimal, but later needed to split it apart without rounding as well. The whole number is miles and the decimal is ‘chains’, where 80 chains is equal to 1 mile. I had converted the 80 chains to 10 based decimal so we could sum total chains and let it also increment the miles. Then later separate the whole number (miles) and decimal (chains) so I could convert the decimal form of chains back into it’s own whole number form by multiplying it by 80.

Looks to be very similar, but in my case I think I rounded the original value, then created a second value of the rounded number - 1. Then I subtracted the rounded value from the original number. If negative (due to rounding up), then I used the column with the number -1. If positive, then I used the original rounded column since it rounded down. That gave me the final whole number value and I subtracted that from the original value to get the chains decimal value by itself.

> [@Tips to improve my prototype app](https://community.glideapps.com/t/tips-to-improve-my-prototype-app/8299/27):
>
> Well, I won’t dive too deep into the solution since it sounds like it wasn’t a good solution. I just know that the values need to be split on the decimal and that’s the only way I could think of to do it entirely within glide so the decimal would be separated to properly convert back into chains. I didn’t consider rounding in this case. Here’s a slight rework of the logic. Total is still the total as calculated from the rollup from the Haulage sheet. mth-MileageWhole is still the…

---

_[View the full topic](https://community.glideapps.com/t/trunc-function-in-math-column-or-send-results-to-sheet/14863)._
