Convert seconds to compound duration: Difference between revisions

Content deleted Content added
Rdm (talk | contribs)
m J: minor bit of documentation on what's happening
Rdm (talk | contribs)
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 correspond to zero, combines the rest and then removes the trailing comma from the end of the resulting line.
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: