Convert seconds to compound duration: Difference between revisions
Content added Content deleted
Line 2,348: | Line 2,348: | ||
=={{header|Mathematica}}/{{header|Wolfram Language}}== |
=={{header|Mathematica}}/{{header|Wolfram Language}}== |
||
<lang Mathematica> |
<lang Mathematica>compoundDuration[x_Integer] := |
||
compoundDuration[x_Integer] := |
|||
StringJoin @@ (Riffle[ |
StringJoin @@ (Riffle[ |
||
ToString /@ ((({Floor[x/604800], |
ToString /@ ((({Floor[x/604800], |
||
Line 2,360: | Line 2,359: | ||
Grid[Table[{n, "secs =", |
Grid[Table[{n, "secs =", |
||
compoundDuration[n]}, {n, {7259, 86400, 6000000}}], |
compoundDuration[n]}, {n, {7259, 86400, 6000000}}], |
||
Alignment -> {Left, Baseline}] |
Alignment -> {Left, Baseline}]</lang> |
||
</lang> |
|||
{{out}} |
{{out}} |
||
⚫ | |||
<pre> |
|||
⚫ | |||
86400 secs = 1 d, |
86400 secs = 1 d, |
||
6000000 secs = 9 wk, 6 d, 10 hr, 40 min, |
6000000 secs = 9 wk, 6 d, 10 hr, 40 min,</pre> |
||
</pre> |
|||
=={{header|Nim}}== |
=={{header|Nim}}== |