Convert seconds to compound duration: Difference between revisions

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