Difference between revisions of "Template:Numtext"
From LGPedia
(This, again, should fix all known bugs. New procedure: Consider this working once I added it to LGPedia:Templates) |
m |
||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | <includeonly>{{#ifexpr: {{{1}}} mod 100 | {{#ifexpr: ({{{1}}}-({{{1}}} mod 100)) / 100 | {{numtext/single|{{#expr: ({{{1}}}-({{{1}}} mod 100)) / 100}}}}-hundred <nowiki> </nowiki>|}}{{#ifexpr: (({{{1}}} mod 100) > 10) and (({{{1}}} mod 100) < 20)|{{numtext/special|{{#expr: {{{1}}} mod 10}}| count }}|{{numtext/double|{{#expr: (({{{1}}} mod 100) - ({{{1}}} mod 10)) / 10}}| {{#ifexpr: not ({{{1}}} mod 10) | count |}}}}{{#ifexpr: ({{{1}}} mod 10) and ({{{1}}} > 20) | - |}}{{numtext/single|{{#expr: {{{1}}} mod 10}}|count}}}}|{{#ifexpr: {{{1}}} | {{numtext/single|{{#expr: ({{{1}}}-({{{1}}} mod 100)) / 100}}}}-hundredth|zeroth}}}}</includeonly><noinclude>This template converts integers, specifically episode numbers, into their textual, counting representation, e.g. it turns 251 into "two-hundred fifty-first". | + | <includeonly>{{#ifexpr: {{{1}}} mod 100 | {{#ifexpr: ({{{1}}}-({{{1}}} mod 100)) / 100 | {{numtext/single|{{#expr: ({{{1}}}-({{{1}}} mod 100)) / 100}}}}-hundred <nowiki> </nowiki>|}}{{#ifexpr: (({{{1}}} mod 100) > 10) and (({{{1}}} mod 100) < 20)|{{numtext/special|{{#expr: {{{1}}} mod 10}}| count }}|{{numtext/double|{{#expr: (({{{1}}} mod 100) - ({{{1}}} mod 10)) / 10}}| {{#ifexpr: not ({{{1}}} mod 10) | count |}}}}{{#ifexpr: ({{{1}}} mod 10) and (({{{1}}} mod 100) > 20) | - |}}{{numtext/single|{{#expr: {{{1}}} mod 10}}|count}}}}|{{#ifexpr: {{{1}}} | {{numtext/single|{{#expr: ({{{1}}}-({{{1}}} mod 100)) / 100}}}}-hundredth|zeroth}}}}</includeonly><noinclude>This template converts integers, specifically episode numbers, into their textual, counting representation, e.g. it turns 251 into "two-hundred fifty-first". |
==Usage== | ==Usage== | ||
<pre>{{numtext|EPISODE NUMBER}}</pre> | <pre>{{numtext|EPISODE NUMBER}}</pre> | ||
− | To reduce load on the server, <code><nowiki>{{subst:{{numtext|EPISODE NUMBER}}}}</nowiki></code> can be used, although this requires manual text changes later, rather than just the number.</noinclude> | + | To reduce load on the server, <code><nowiki>{{subst:{{numtext|EPISODE NUMBER}}}}</nowiki></code> can be used, although this requires manual text changes later, rather than just the number. |
+ | |||
+ | To edit numeral phrases, edit [[Template:Numtext/single|Numtext/single]] single-digit numbers, [[Template:Numtext/double|Numtext/double]] for double-digit numbers, and [[Template:Numtext/special|Numtext/special]] for numbers 11-19. | ||
+ | [[Category:Templates|{{PAGENAME}}]]</noinclude> |
Latest revision as of 13:48, 22 January 2008
This template converts integers, specifically episode numbers, into their textual, counting representation, e.g. it turns 251 into "two-hundred fifty-first".
Usage
{{numtext|EPISODE NUMBER}}
To reduce load on the server, {{subst:{{numtext|EPISODE NUMBER}}}}
can be used, although this requires manual text changes later, rather than just the number.
To edit numeral phrases, edit Numtext/single single-digit numbers, Numtext/double for double-digit numbers, and Numtext/special for numbers 11-19.