Template:Time/Sandbox: Difference between revisions

From Melvor Idle
(Created page with "<onlyinclude><includeonly><!--Definition of variables--> {{#vardefine:TotalSeconds|{{formatnum:{{{1|}}}|R}}}}{{#vardefine:Time|{{#var:TotalSeconds}}}}{{#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...")
 
(Sandbox doesn't need docs)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<onlyinclude><includeonly><!--Definition of variables-->
<onlyinclude><includeonly>{{#invoke:Time|secondsToHuman}}</includeonly></onlyinclude>
{{#vardefine:TotalSeconds|{{formatnum:{{{1|}}}|R}}}}{{#vardefine:Time|{{#var:TotalSeconds}}}}{{#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-->{{#ifeq:{{formatnum:{{{1|}}}|R}}|0
|0 seconds
|{{#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}}}}{{#ifexpr:{{#var:Seconds}} > 0|, {{#var:Seconds}} second{{#ifexpr:{{#var:Seconds}} > 1|s}}}}
}}
</includeonly></onlyinclude><noinclude>{{/doc}}</noinclude>

Latest revision as of 12:19, 30 June 2024