Jump to content

Template:Pp

From mediawiki.org

{{Pp|?|...}}

Template documentation
For the template used to indicate a page is protected, see {{Pp-template }}. MediaWiki.org does not use protection templates for other uses.

This template contains {{{{{{1}}}}}}.

If the first parameter is an integer > 1 this template corresponds to:

{{p{{#expr:{{{1}}}-1}}|{{{2}}}|{{{3}}}|{{{4}}}|..}}

Apart from the fact that it does not trim the result it also corresponds to:

{{#switch:{{{1}}}|2={{{2}}}|3={{{3}}}|4={{{4}}}|..}}

or similar with other parameter names.

If lb is a lower bound on the values of {{{1}}} we can use {{pp|{{#expr:{{{1}}}+2-lb}}|fa|fb|..}}. This not only allows low values of {{{1}}} if the lower bound is less than 2, but it also reduces the parameter numbers if the lower bound is greater than 2. For example, if {{{1}}} is in the range 100-110 we can use unnamed parameters without specifying dummy values for the parameters 2-99: {{pp|{{#expr:{{{1}}}-98}}|f100|f101|..}}.

Usage

[edit]
  • "{{pp| a | a = 9 | b = 7 }}" gives "9"
  • "{{pp| b | a = 9 | b = 7 }}" gives "7"

Compare:

  • "{{p1| 9 | 7 }}" gives " 9 " [1]
  • "{{p2| 9 | 7 }}" gives " 7 " [2]
  • {{sw|2||2| 9 |3| 7 }} gives "9"
  • {{sw|3||2| 9 |3| 7 }} gives "7"

Trimming:

  • {{#switch:2|2= 9 |3= 7 }} gives "9"
  • {{#switch:3|2= 9 |3= 7 }} gives "7"