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"> |
||
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 |
print split 7259 |
||
print |
print split 86400 |
||
⚫ | |||
split 86400 s$ |
|||
print s$ |
|||
⚫ | |||
print s$ |
|||
</syntaxhighlight> |
</syntaxhighlight> |
||