Difference between revisions of "Template:Count"
Jump to navigation
Jump to search
imported>Who R you? (Split out documentation; with testcases added) |
imported>Frietjes |
||
| Line 1: | Line 1: | ||
| − | + | {{#ifexpr:{{#invoke:ParameterCount|main|pattern1=^[%d]+$}}>0|{{#invoke:ParameterCount|main|pattern1=^[%d]+$}}|{{{base|0}}}}}<noinclude>{{documentation}}</noinclude> | |
| − | |||
| − | |||
Revision as of 19:06, 12 December 2016
0
| 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. |