Difference between revisions of "Template:Numtext"
From LGPedia
(This should fix all known bugs and adds documentation. I am testing further, but if this page doesn't change within the next thirty minutes, assume this is operational.) |
(This, again, should fix all known bugs. New procedure: Consider this working once I added it to LGPedia:Templates) |
||
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 | - |}}{{numtext/single|{{#expr: {{{1}}} mod 10}}|count | + | <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". |
==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.</noinclude> |
Revision as of 16:07, 20 September 2007
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.