Difference between revisions of "Template:Count"
Jump to navigation
Jump to search
imported>Who R you? (Returns a count of the number of *defined* parameters passed — Optionally zero or one based if no *defined* parameters passed — Currently only supports passing 10 parameters) |
imported>Who R you? (Split out documentation; with testcases added) |
||
| Line 1: | Line 1: | ||
| − | < | + | <!-- ■■ Add categories to the bottom of the documentation page. ■■ --><!-- |
| + | ■► NOTE: Update [[Template:Count/doc]] and [[Template:Count/testcases]] if support is added for more parameters. ◄■ | ||
| + | --><includeonly>{{#expr:{{#if:{{{1|}}}|1|0}}+{{#if:{{{2|}}}|1|0}}+{{#if:{{{3|}}}|1|0}}+{{#if:{{{4|}}}|1|0}}+{{#if:{{{5|}}}|1|0}}+{{#if:{{{6|}}}|1|0}}+{{#if:{{{7|}}}|1|0}}+{{#if:{{{8|}}}|1|0}}+{{#if:{{{9|}}}|1|0}}+{{#if:{{{10|}}}|1|0}}+{{#if:{{{1|}}}{{{2|}}}{{{3|}}}{{{4|}}}{{{5|}}}{{{6|}}}{{{7|}}}{{{8|}}}{{{9|}}}{{{10|}}}|0|{{{base|0}}}}}}}</includeonly><noinclude>{{documentation}}</noinclude> | ||
Revision as of 07:44, 20 May 2014
| This template uses Lua: |
Returns a number from (0 or 1) to 10 indicating the number of defined parameters passed. Currently supports a maximum of 10 parameters.
Usage
Set base=0 or base=1 to change from the default value returned if there are no defined parameters. (i.e. If no defined parameters, returns 0 by default (or 1 if base=1))
Examples
Note: {{ Count/testcase1 }} tests nesting of templates calling {{ Count }}.
See also
- {{Counter}}
- module:ParameterCount, with more options
| The above documentation is transcluded from Template:Count/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (edit) pages. Please add categories to the /doc subpage. Subpages of this template. |