title: $:/community/recipes/procedures/toHoursAndMinutes
tags: $:/tags/community/recipes/procedure
type: text/vnd.tiddlywiki

\procedure toHoursAndMinutes()
\whitespace trim
<$let total={{{ [<field-value>add[0]] }}}
      h={{{ [<total>divide[60]floor[]] }}}
      m={{{ [<total>remainder[60]] }}}>
<%if [<h>match[0]] %>
<<m>>&nbsp;<%if [<m>!match[1]] %><<t Procedures/HoursAndMinutes/Minutes>><%else%><<t Procedures/HoursAndMinutes/Minute>><%endif%>
<%else%>
<<h>>&nbsp;<%if [<h>!match[1]] %><<t Procedures/HoursAndMinutes/Hours>><%else%><<t Procedures/HoursAndMinutes/Hour>><%endif%>
<%if [<m>!match[0]] %>
&nbsp;<<m>>&nbsp;<%if [<m>!match[1]] %><<t Procedures/HoursAndMinutes/Minutes>><%else%><<t Procedures/HoursAndMinutes/Minute>><%endif%>
<%endif%>
<%endif%>
</$let>
\end
