Difference between revisions of "Template:Numtext"

From LGPedia
Jump to: navigation, search
(Not done yet, just testing.)
 
(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.)
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)
+
<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}}}}}|{{#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".
|{{numtext/special|{{#expr: (({{{1}}} mod 100) - ({{{1}}} mod 10)) / 10}}| count }}
+
 
|{{numtext/double|{{#expr: (({{{1}}} mod 100) - ({{{1}}} mod 10)) / 10}}| {{#ifexpr: not ({{{1}}} mod 10) | count |}}}}{{#ifexpr: {{{1}}} mod 10 | <nowiki> </nowiki> |}}{{numtext/single|{{#expr: {{{1}}} mod 10}}|{{#ifexpr: {{{1}}} mod 10 | count |}}}}
+
==Usage==
}}|{{numtext/single|{{#expr: ({{{1}}}-({{{1}}} mod 100)) / 100}}}}-hundredth}}</includeonly>
+
<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>

Revision as of 15:53, 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.