{{/*
  Format Hours Partial

  Converts hours to days when >= 24 hours.

  Usage: {{ partial "format-hours.html" 536.1 }}

  Output:
    - 12<span class="unit">h</span> (for values < 24)
    - 2<span class="unit">d</span> (for values >= 24)
*/}}

{{- $hours := . -}}
{{- if ge $hours 24 -}}
  {{- $days := div $hours 24 -}}
  {{- printf "%.0f" $days -}}<span class="time-unit">d</span>
{{- else -}}
  {{- printf "%.0f" $hours -}}<span class="time-unit">h</span>
{{- end -}}
