Convert seconds to compound duration: Difference between revisions
Content deleted Content added
m J: minor bit of documentation on what's happening |
m J: simplify grammar |
||
Line 1,815: | Line 1,815: | ||
The first line uses integer division with remainder to break the value in seconds into its components (weeks, days, hours, minutes, seconds). |
The first line uses integer division with remainder to break the value in seconds into its components (weeks, days, hours, minutes, seconds). |
||
The second line gives each value a label and a trailing comma, drops the parts which |
The second line gives each value a label and a trailing comma, drops the parts which have a zero, combines the rest and then removes the trailing comma from the end of the resulting line. |
||
Task examples: |
Task examples: |