Jump to content

Convert seconds to compound duration: Difference between revisions

m
Line 1,555:
=={{header|EasyLang}}==
<syntaxhighlight lang="text">
procfunc$ split sec . s$ .
divs[] = [ 60 60 24 7 ]
n$[] = [ "sec" "min" "hr" "d" "wk" ]
Line 1,564:
.
r[5] = sec
s$ = ""
for i = 5 downto 1
if r[i] <> 0
Line 1,573 ⟶ 1,572:
.
.
return s$
.
print split 7259 s$
print s$split 86400
print split 6000000 s$
split 86400 s$
print s$
split 6000000 s$
print s$
</syntaxhighlight>
 
2,063

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.