def duration
import cswap-bend-cli@0.1.0.0/tui/fmt.bend as Fmtimport Base
73# The shortest honest duration: 45s, 12m, 2h 13m, 2h, 3d 4h, 3d.
74def duration(+s: U32) -> String:
75 sel.s(U32.is_lt(s, 60), U32.show(s) ++ "s",
76 sel.s(U32.is_lt(s, 3600), U32.show((s / 60 : U32)) ++ "m",
77 sel.s(U32.is_lt(s, 86400), hm(s), dh(s))))