Template:MAEpcode: Difference between revisions

From LGPedia
Jump to navigationJump to search
No edit summary
Kevin (talk | contribs)
No edit summary
 
(One intermediate revision 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}}} | chapter = 0 | 0x{{{1}}} }} |}}<!-- -->{{ #ifexpr: ({{{1}}} >= 1) and ({{{1}}} <= 13) | {{#switch: {{{2}}} | raw = {{#expr:{{{1}}}}} | chapter = 1 | 1x{{ #ifexpr: {{{1}}} < 100 |0|}}{{ #ifexpr: {{{1}}} < 10 |0|}}{{#expr:{{{1}}}}} }} |}}<!-- -->{{ #ifexpr: ({{{1}}} >= 14) and ({{{1}}} <= 41) | {{#switch: {{{2}}} | raw = {{#expr: {{{1}}}-13 }} | chapter = 2 | 2x{{ #ifexpr: ({{{1}}}-13) < 100 |0|}}{{ #ifexpr: ({{{1}}}-13) < 10 |0|}}{{#expr: {{{1}}}-13 }} }} |}}<!-- -->{{ #ifexpr: {{{1}}} >= 42 | {{#switch: {{{2}}} | raw = {{#expr: {{{1}}}-41 }} | chapter = 3 | 3x{{ #ifexpr: ({{{1}}}-41) < 100 |0|}}{{ #ifexpr: ({{{1}}}-41) < 10 |0|}}{{#expr: {{{1}}}-41 }} }} |}}<!-- -->|}}</includeonly><noinclude>This template generates episode codes in the form of (chapternumber)x(episodenumber within chapter) from normal, continuous episode numbers.<br>'''Usage:''' <code><nowiki>{{MAEpcode|Normal episode number}}</nowiki></code><br>'''Example:''' <code><nowiki>{{MAEpcode|37}}</nowiki></code> gives {{MAEpcode|37}}<br><code>raw</code> can be passed as a second argument to turn off the leading #x.<br><code>chapter</code> can be passed as a second argument to return only the chapter number.<br>If the input is not a number, nothing is returned.[[Category:Templates|{{PAGENAME}}]]</noinclude>
<noinclude>{{Delete|Delete and move to Maddypedia.}}</noinclude>
<includeonly>{{ #if: {{#ifeq: {{#ifexpr: {{{1}}} | true|true}} | true | {{{1|}}} |}} <!-- -->|{{ #ifexpr: {{{1}}} <= 0 | {{#switch: {{{2}}} | raw = {{{1}}} | chapter = 0 | 0x{{{1}}} }} |}}<!-- -->{{ #ifexpr: ({{{1}}} >= 1) and ({{{1}}} <= 13) | {{#switch: {{{2}}} | raw = {{#expr:{{{1}}}}} | chapter = 1 | 1x{{ #ifexpr: {{{1}}} < 100 |0|}}{{ #ifexpr: {{{1}}} < 10 |0|}}{{#expr:{{{1}}}}} }} |}}<!-- -->{{ #ifexpr: ({{{1}}} >= 14) and ({{{1}}} <= 41) | {{#switch: {{{2}}} | raw = {{#expr: {{{1}}}-13 }} | chapter = 2 | 2x{{ #ifexpr: ({{{1}}}-13) < 100 |0|}}{{ #ifexpr: ({{{1}}}-13) < 10 |0|}}{{#expr: {{{1}}}-13 }} }} |}}<!-- -->{{ #ifexpr: {{{1}}} >= 42 | {{#switch: {{{2}}} | raw = {{#expr: {{{1}}}-41 }} | chapter = 3 | 3x{{ #ifexpr: ({{{1}}}-41) < 100 |0|}}{{ #ifexpr: ({{{1}}}-41) < 10 |0|}}{{#expr: {{{1}}}-41 }} }} |}}<!-- -->|}}</includeonly><noinclude>This template generates episode codes in the form of (chapternumber)x(episodenumber within chapter) from normal, continuous episode numbers.<br>'''Usage:''' <code><nowiki>{{MAEpcode|Normal episode number}}</nowiki></code><br>'''Example:''' <code><nowiki>{{MAEpcode|37}}</nowiki></code> gives {{MAEpcode|37}}<br><code>raw</code> can be passed as a second argument to turn off the leading #x.<br><code>chapter</code> can be passed as a second argument to return only the chapter number.<br>If the input is not a number, nothing is returned.[[Category:UGC page templates|{{PAGENAME}}]]</noinclude>

Latest revision as of 17:44, 16 May 2009

This article has been nominated for deletion
Reason: Delete and move to Maddypedia.

Please discuss this proposal on this article's talk page

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