Misplaced Pages

Template:Numrec: Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Browse history interactively← Previous editNext edit →Content deleted Content addedVisualWikitext
Revision as of 05:38, 13 June 2017 view sourceKoavf (talk | contribs)Extended confirmed users2,174,994 editsmNo edit summary← Previous edit Revision as of 15:59, 2 June 2018 view source Wiz9999 (talk | contribs)Extended confirmed users4,195 edits Added (spell=N) to the template to enable the removal of spelling out numbers <10 when needed.Next edit →
Line 1: Line 1:
{{#ifeq: {{{asof}}}|S|{{{alt|As of}}}{{sp}}{{#if: {{Numrec/{{{1|Pal}}}|D}}|{{Numrec/{{{1|Pal}}}|D}}{{sp}}}}{{#if: {{Numrec/{{{1|Pal}}}|M}}|{{Numrec/{{{1|Pal}}}|M}}{{sp}}}}{{Numrec/{{{1|Pal}}}|Y}},{{sp}}}}{{#if: {{{alt2|}}}|{{{alt2}}}{{sp}}}}{{#ifeq: {{{link}}}|N|{{#if: {{{2|}}}|{{{2}}}&nbsp;}}{{#if: {{{pcent|}}}|{{pct|{{#expr:{{Numrec/{{{1|Pal}}}|{{#if: {{{W|}}}|W|N}} }}+{{{N|0}}}}}|{{#ifeq:{{{pcent}}}|UN|{{UNnum}}|{{{pcent}}}}}|1}}|{{#ifexpr:{{Numrec/{{{1|Pal}}}|{{#if: {{{W|}}}|W|N}} }}+{{{N|0}}}<10 | {{spellnum|{{#expr:{{Numrec/{{{1|Pal}}}|{{#if: {{{W|}}}|W|N}} }}+{{{N|0}}}}}}} | {{#expr:{{Numrec/{{{1|Pal}}}|{{#if: {{{W|}}}|W|N}} }}+{{{N|0}}}}} }}}}{{#if:{{{3|}}}|&nbsp;{{{3}}} }}|]}}{{#ifeq:{{{asof}}}|E|{{sp}}{{{alt|as of}}}{{sp}}{{#if: {{Numrec/{{{1|Pal}}}|D}}|{{Numrec/{{{1|Pal}}}|D}}{{sp}}}}{{#if:{{Numrec/{{{1|Pal}}}|M}}|{{Numrec/{{{1|Pal}}}|M}}{{sp}}}}{{Numrec/{{{1|Pal}}}|Y}} }}<noinclude>{{documentation {{#ifeq: {{{asof}}}|S|{{{alt|As of}}}{{sp}}{{#if: {{Numrec/{{{1|Pal}}}|D}}|{{Numrec/{{{1|Pal}}}|D}}{{sp}}}}{{#if: {{Numrec/{{{1|Pal}}}|M}}|{{Numrec/{{{1|Pal}}}|M}}{{sp}}}}{{Numrec/{{{1|Pal}}}|Y}},{{sp}}}}{{#if: {{{alt2|}}}|{{{alt2}}}{{sp}}}}{{#ifeq: {{{link}}}|N|{{#if: {{{2|}}}|{{{2}}}&nbsp;}}{{#if: {{{pcent|}}}|{{pct|{{#expr:{{Numrec/{{{1|Pal}}}|{{#if: {{{W|}}}|W|N}} }}+{{{N|0}}}}}|{{#ifeq:{{{pcent}}}|UN|{{UNnum}}|{{{pcent}}}}}|1}}|{{#ifeq: {{{spell}}}|N|{{#expr:{{Numrec/{{{1|Pal}}}|{{#if: {{{W|}}}|W|N}} }}+{{{N|0}}} }}|{{#ifexpr:{{Numrec/{{{1|Pal}}}|{{#if: {{{W|}}}|W|N}} }}+{{{N|0}}}<10 | {{spellnum|{{#expr:{{Numrec/{{{1|Pal}}}|{{#if: {{{W|}}}|W|N}} }}+{{{N|0}}}}}}} | {{#expr:{{Numrec/{{{1|Pal}}}|{{#if: {{{W|}}}|W|N}} }}+{{{N|0}}}}} }}}}}}{{#if:{{{3|}}}|&nbsp;{{{3}}} }}|]}}{{#ifeq:{{{asof}}}|E|{{sp}}{{{alt|as of}}}{{sp}}{{#if: {{Numrec/{{{1|Pal}}}|D}}|{{Numrec/{{{1|Pal}}}|D}}{{sp}}}}{{#if:{{Numrec/{{{1|Pal}}}|M}}|{{Numrec/{{{1|Pal}}}|M}}{{sp}}}}{{Numrec/{{{1|Pal}}}|Y}} }}<noinclude>{{documentation
|content = |content =
This template is used to display the current number of member states which recognize a particular state. To update the number, month, year, or name produced by this template, you must modify the corresponding subtemplate. This template is used to display the current number of member states which recognize a particular state. To update the number, month, year, or name produced by this template, you must modify the corresponding subtemplate.
Line 13: Line 13:
* <code>alt2 = bar</code> to add "bar" after the "As of" date and before the wikilinked text * <code>alt2 = bar</code> to add "bar" after the "As of" date and before the wikilinked text
* <code>link = N</code> to turn off linking * <code>link = N</code> to turn off linking
* <code>spell = N</code> to turn off spelling out numbers less than 10 and listing them simply as integers.
* <code>pcent = total number</code> to add a percentage out of "total number". If pcent=UN then the total number of UN member states is used. * <code>pcent = total number</code> to add a percentage out of "total number". If pcent=UN then the total number of UN member states is used.
* <code>N = number</code> outputs "Number of recognizers + N". This is useful in situations where non-UN member states are to be included in the total. * <code>N = number</code> outputs "Number of recognizers + N". This is useful in situations where non-UN member states are to be included in the total.
Line 20: Line 21:
* <code><nowiki>{{Numrec|Pal|the|countries}}</nowiki></code> → {{Numrec|Pal|the|countries}} * <code><nowiki>{{Numrec|Pal|the|countries}}</nowiki></code> → {{Numrec|Pal|the|countries}}
* <code><nowiki>{{Numrec|Pal|the|countries|link=N}}</nowiki></code> → {{Numrec|Pal|the|countries|link=N}} * <code><nowiki>{{Numrec|Pal|the|countries|link=N}}</nowiki></code> → {{Numrec|Pal|the|countries|link=N}}
* <code><nowiki>{{Numrec|Abkhazia|the|countries}}</nowiki></code> → {{Numrec|Abkhazia|the|countries}}
* <code><nowiki>{{Numrec|Abkhazia|the|countries|spell=N}}</nowiki></code> → {{Numrec|Abkhazia|the|countries|spell=N}}
* <code><nowiki>{{Numrec|Pal|although|of the countries|link=N|pcent=193}}</nowiki></code> → {{Numrec|Pal|although|of the countries|link=N|pcent=193}} * <code><nowiki>{{Numrec|Pal|although|of the countries|link=N|pcent=193}}</nowiki></code> → {{Numrec|Pal|although|of the countries|link=N|pcent=193}}
* <code><nowiki>{{Numrec|Pal|a total of|countries ...|link=N|asof=S}}</nowiki></code> → {{Numrec|Pal|a total of|countries ...|link=N|asof=S}} * <code><nowiki>{{Numrec|Pal|a total of|countries ...|link=N|asof=S}}</nowiki></code> → {{Numrec|Pal|a total of|countries ...|link=N|asof=S}}

Revision as of 15:59, 2 June 2018

146

Template documentation

This template is used to display the current number of member states which recognize a particular state. To update the number, month, year, or name produced by this template, you must modify the corresponding subtemplate.

List of subtemplates

Usage

The first parameter corresponds to a subtemplate of this template, e.g., Pal for {{Numrec/Pal}}. The second and third parameter inserts wikilinked text before and after the number. Other optional parameters are:

  • asof = S to turn on the "As of" prefix (start)
  • asof = E to turn on the "as of" suffix (end)
  • alt = foo to change the "As of" prefix to "foo"
  • alt2 = bar to add "bar" after the "As of" date and before the wikilinked text
  • link = N to turn off linking
  • spell = N to turn off spelling out numbers less than 10 and listing them simply as integers.
  • pcent = total number to add a percentage out of "total number". If pcent=UN then the total number of UN member states is used.
  • N = number outputs "Number of recognizers + N". This is useful in situations where non-UN member states are to be included in the total.
  • W = Y outputs number of states who have withdrawn recognition as opposed to the number of recognizers.

Examples

  • {{Numrec|Pal|the|countries}}the 146 countries
  • {{Numrec|Pal|the|countries|link=N}} → the 146 countries
  • {{Numrec|Abkhazia|the|countries}}the seven countries
  • {{Numrec|Abkhazia|the|countries|spell=N}}the 7 countries
  • {{Numrec|Pal|although|of the countries|link=N|pcent=193}} → although 75.6% of the countries
  • {{Numrec|Pal|a total of|countries ...|link=N|asof=S}} → As of 21 June 2024, a total of 146 countries ...
  • {{Numrec|Pal|a total of|countries ...|link=N|asof=S|alt=as of }} → as of 21 June 2024, a total of 146 countries ...
  • {{Numrec|Pal|a total of|countries ...|link=N|asof=E}} → a total of 146 countries ... as of 21 June 2024
  • {{Numrec|Pal|a total of|countries ...|link=N|asof=E|alt=, by }} → a total of 146 countries ... , by 21 June 2024
Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
Subpages of this template. Category: