Convert seconds to compound duration: Difference between revisions
Convert seconds to compound duration (view source)
Revision as of 08:13, 23 October 2022
, 1 year ago→{{header|EasyLang}}
No edit summary |
|||
Line 1,521:
=={{header|EasyLang}}==
<syntaxhighlight lang="text">
func split sec . s$ .
divs[] = [ 60 60 24 7 ]
n$[] = [ "sec" "min" "hr" "d" "wk" ]
len r[] 5
for i
r[i] = sec mod divs[i]
sec = sec div divs[i]
.
r[
s$ = ""
for i =
if r[i] <> 0
if s$ <> ""
Line 1,545 ⟶ 1,546:
print s$
call split 6000000 s$
print s$
</syntaxhighlight>
{{out}}
|