This is a classic example of where a single experimental code column can save you a *bunch* of Glide computed columns.

My use case:

I have a column where the value in each row represents a duration in minutes, and I need to format that for display as hh:mm. So, for example…

- 2914 => 48:34
- 804 => 13:24
- 63 => 01:03
- 5 => 00:05
- 0 => blank

As far as I could tell, none of the plugin columns will handle this. But it looks easy, right?

Well, the best I could do with Glide computed columns was 6 (!!) columns

If anyone - @Jeff_Hager - can improve on that, please let me know. It went like this:

- Column 1: Math column to get the number of whole hours.
`Floor(total/60)`

- Column 2: If-then-else column to zero pad the hours…

– If hours < 10 then 0, else blank - Column 3: Math column to get the remaining minutes.
`Mod(total,60)`

- Column 4: If-then-else column to zero pad the minutes…

– If mins < 10 then 0, else blank - Column 5: Template column to stitch them together…
`{hh-padding}{hh}:{min-padding}{min}`

- Column 6: If-then-else column to deal with the case where the total minutes is zero or empty…

– If total is empty, then empty

– If total equals 0, then empty

– Else template column

Which looked like:

If it only had to be done once, then it’s not so bad. But for my use case I had to do this about 20 times After the 3rd or 4th time, I’d had enough. So decided to swap those 6 columns out for a single experimental code column…

https://mcdarren.github.io/glide-mins-to-hhmm

```
window.function = function (total) {
if (total.value === undefined) return undefined;
if (total.value === 0) return undefined;
var hours = Math.floor(total.value/60);
var mins = total.value % 60;
return hours.toString().padStart(2, '0') + ":" + mins.toString().padStart(2, '0');
}
```

Which results in:

So that’s 5x20=100 computed columns saved with just a few lines of javascript