Convert seconds to compound duration: Difference between revisions
m
→{{header|Phix}}: (used iff a bit more)
m (→version 2: elided a blank line from the source.) |
m (→{{header|Phix}}: (used iff a bit more)) |
||
Line 1,180:
m = floor(s/60)
s = remainder(s,60)
secs = sprintf("%ds",s)▼
if m=0 then
return sprintf("%s%s",{minus,secs})
end if
s = round(s)
h = floor(m/60)
m = remainder(m,60)
Line 1,199 ⟶ 1,191:
return sprintf("%s%s%s",{minus,elapzd(m,"minute"),secs})
end if
▲ mins = ", "&elapzd(m,"minute")
if h<24 then
return sprintf("%s%s%s%s",{minus,elapzd(h,"hour"),mins,secs})
|