2,875
edits
No edit summary |
m (Prefer modulo operator for accuracy) |
||
Line 1: | Line 1: | ||
<onlyinclude><includeonly>{{#vardefine:Time|{{formatnum:{{{1|}}}|R}}}}{{#vardefine:Days|{{#expr:floor({{#var:Time}} / 86400)}}}}{{#vardefine:Time|{{#expr:{{#var:Time}} | <onlyinclude><includeonly><!-- | ||
-->{{#ifexpr:{{#var:Days}} > 0|{{#var:Days}} day{{#ifexpr:{{#var:Days}}<>1|s}}, }}{{#ifexpr:{{#var:Hours}} > 0|{{#var:Hours}} hour{{#ifexpr:{{#var:Hours}}<>1|s}}, }}{{#ifexpr:{{#var:Minutes}} > 0|{{#var:Minutes}} minute{{#ifexpr:{{#var:Minutes}}<>1|s}}, }}{{#var:Seconds}} second{{#ifexpr:{{#var:Seconds}}<>1|s}}</includeonly></onlyinclude><noinclude>{{/doc}}</noinclude> | Definition of variables-->{{#vardefine:Time|{{formatnum:{{{1|}}}|R}}}}{{#vardefine:Days|{{#expr:floor({{#var:Time}} / 86400)}}}}{{#vardefine:Time|{{#expr:{{#var:Time}} mod 86400}}}}{{#vardefine:Hours|{{#expr:floor({{#var:Time}} / 3600)}}}} | ||
{{#vardefine:Time|{{#expr:{{#var:Time}} mod 3600}}}}{{#vardefine:Minutes|{{#expr:floor({{#var:Time}} / 60)}}}}{{#vardefine:Time|{{#expr:{{#var:Time}} mod 60}}}}{{#vardefine:Seconds|{{#var:Time}}}}<!-- | |||
Output of template-->{{#ifexpr:{{#var:Days}} > 0|{{#var:Days}} day{{#ifexpr:{{#var:Days}}<>1|s}}, }}{{#ifexpr:{{#var:Hours}} > 0|{{#var:Hours}} hour{{#ifexpr:{{#var:Hours}}<>1|s}}, }}{{#ifexpr:{{#var:Minutes}} > 0|{{#var:Minutes}} minute{{#ifexpr:{{#var:Minutes}}<>1|s}}, }}{{#var:Seconds}} second{{#ifexpr:{{#var:Seconds}}<>1|s}}</includeonly></onlyinclude><noinclude>{{/doc}}</noinclude> |
edits