User:Stux/sandbox2
From Homestar Runner Wiki
Testing time:
{{#time: z | 20071031}}
Yields: 303
- 121 seconds?
{{#time: i:s | 121}}
Yields: Error: invalid time
- So time doesn't support converting seconds to "hh:mm:ss" format, unfortunately. We gotta do it manually using Help:ParserFunctions##expr:, but now we have two more problems:
- There is no modulo operation, and we can't use "round" to easily emulate it.
- So, here goes nothing:
{{#expr: 121%60}} <br/><!-- confirm there is no modulo -->
{{#expr: 121 mod 60}} <br/><!-- confirm there is no modulo -->
{{#expr: 121/60}} <br/><!-- convert 121 seconds to minutes -->
{{#expr: 119/60}} <br/><!-- convert 119 seconds to minutes -->
{{#expr: 121/60 round 0}} <br/><!-- round 121 seconds to minutes -->
{{#expr: 119/60 round 0}} <br/><!-- round 119 seconds to minutes -->
Expression error: Unrecognised punctuation character "%"
1
2.0166666666667
1.9833333333333
2
2
- Fortunately, we should be able to use the above logic for IF statements. Unfortunately, this crazy logic may time out...
