Difference between revisions of "Template:KMEpcode"

From LGPedia
Jump to: navigation, search
m
 
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
<includeonly>{{ #if: {{#ifeq: {{#ifexpr: {{{1}}} | true|true}} | true | {{{1|}}} |}} <!-- -->|{{ #ifexpr: {{{1}}} <= 0 | {{#switch: {{{2}}} | raw = {{{1}}} | season = 0 | 0x{{{1}}} }} |}}<!-- -->{{ #ifexpr: ({{{1}}} >= 1) and ({{{1}}} <= 156) | {{#switch: {{{2}}} | raw = {{#expr:{{{1}}}}} | season = 1 | 1x{{ #ifexpr: {{{1}}} < 100 |0|}}{{ #ifexpr: {{{1}}} < 10 |0|}}{{#expr:{{{1}}}}} }} |}}<!-- -->{{ #ifexpr: {{{1}}} >= 157 | {{#switch: {{{2}}} | raw = {{#expr: {{{1}}}-156 }} | season = 2 | 2x{{ #ifexpr: ({{{1}}}-156) < 100 |0|}}{{ #ifexpr: ({{{1}}}-156) < 10 |0|}}{{#expr: {{{1}}}-156 }} }} |}}<!-- -->|}}</includeonly><noinclude>This template generates episode codes in the form of (seasonnumber)x(episodenumber within season) from normal, continuous episode numbers.<br>'''Usage:''' <code><nowiki>{{KMepcode|Normal episode number}}</nowiki></code><br>'''Example:''' <code><nowiki>{{KMepcode|260}}</nowiki></code> gives {{KMepcode|260}}<br><code>raw</code> can be passed as a second argument to turn off the leading #x.<br><code>season</code> can be passed as a second argument to return only the season number.<br>If the input is not a number, nothing is returned.[[Category:Templates]]</noinclude>
+
<includeonly>{{ #if: {{#ifeq: {{#ifexpr: {{{1}}} | true|true}} | true | {{{1|}}} |}} <!-- -->|{{ #ifexpr: {{{1}}} <= 0 | {{#switch: {{{2}}} | raw = {{{1}}} | season = 0 | 0x{{{1}}} }} |}}<!-- -->{{ #ifexpr: ({{{1}}} >= 1) and ({{{1}}} <= 155) | {{#switch: {{{2}}} | raw = {{#expr:{{{1}}}}} | season = 1 | 1x{{ #ifexpr: {{{1}}} < 100 |0|}}{{ #ifexpr: {{{1}}} < 10 |0|}}{{#expr:{{{1}}}}} }} |}}<!-- -->{{ #ifexpr: {{{1}}} >= 156 | {{#switch: {{{2}}} | raw = {{#expr: {{{1}}}-155 }} | season = 2 | 2x{{ #ifexpr: ({{{1}}}-155) < 100 |0|}}{{ #ifexpr: ({{{1}}}-155) < 10 |0|}}{{#expr: {{{1}}}-155 }} }} |}}<!-- -->|}}</includeonly><noinclude>This template generates episode codes in the form of (seasonnumber)x(episodenumber within season) from normal, continuous episode numbers.<br>'''Usage:''' <code><nowiki>{{KMEpcode|Normal episode number}}</nowiki></code><br>'''Example:''' <code><nowiki>{{KMEpcode|260}}</nowiki></code> gives {{KMEpcode|260}}<br><code>raw</code> can be passed as a second argument to turn off the leading #x.<br><code>season</code> can be passed as a second argument to return only the season number.<br>If the input is not a number, nothing is returned.[[Category:Templates|{{PAGENAME}}]]</noinclude>

Latest revision as of 20:34, 18 February 2008

This template generates episode codes in the form of (seasonnumber)x(episodenumber within season) from normal, continuous episode numbers.
Usage: {{KMEpcode|Normal episode number}}
Example: {{KMEpcode|260}} gives 2x105
raw can be passed as a second argument to turn off the leading #x.
season can be passed as a second argument to return only the season number.
If the input is not a number, nothing is returned.