Is there a way to format "durations" in a Dataview table?

I use Obsidian to keep my daily journal. I created a Shortcuts automation that sends my workout data from my iPhone and creates a page in Obsidian. Then, Dataview makes a table from that data on my daily page. I have the duration set as a simple decimal (“22.4 mins”), but it gets displayed in the table as “22 minutes, 23 seconds, 1000 ms”.

Is there some sort of syntax I can use to force Dataview to display the duration more compactly? I checked this forum and the Dataview GitHub, but can’t find anything.

MY ORIGINAL ANSWER WAS RUBBISH. See below…

1 Like

If allowed, I just add an extra option using the original “22.4 mins” format:

---
duration: 22.4 mins
---

```dataview
TABLE name AS "Name", duration.minutes AS "⏱", ...
```

If your values in duration are only in minutes, then you can use the duration.minutes to get only minutes. If you use duration.hours you get the conversion of the input value (in minutes) to hours: 22.4 mins → 0.3733

2 Likes

Genius.

:clap: :clap: :clap: :clap: :clap:

Angel