Difference between revisions of "Template:GBP/doc"

From blackwiki
Jump to navigation Jump to search
imported>Vanisaac
m (→‎See also: clean up per WP:CAT#T and WP:AWBREQ add template:Sandbox other)
imported>Bsherr
m (as found, replacing Template:Tld with Template:Tlc or adding/updating category placement comments, plus general and typo fixes)
 
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
+
<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata -->
  
 
This is a multifunction template. At its simplest, it adds the currency mark "{{GBP}}", as recommended by [[MOS:CURRENCY]] for many situations. The template can also link to the [[Pound sterling]] article and can even calculate inflation. <em>See warnings below.</em>
 
This is a multifunction template. At its simplest, it adds the currency mark "{{GBP}}", as recommended by [[MOS:CURRENCY]] for many situations. The template can also link to the [[Pound sterling]] article and can even calculate inflation. <em>See warnings below.</em>
Line 8: Line 8:
  
 
Example:
 
Example:
* {{tld|GBP}} → {{GBP}}
+
* {{tlc|GBP}} → {{GBP}}
* {{tld|GBP|123.45}} → {{GBP|123.45}}
+
* {{tlc|GBP|123.45}} → {{GBP|123.45}}
  
 
=== Link ===
 
=== Link ===
Line 15: Line 15:
  
 
Example:
 
Example:
* {{tld|GBP|123.45|3=link=yes}} → {{GBP|123.45|link=yes}}
+
* {{tlc|GBP|123.45|3=link=yes}} → {{GBP|123.45|link=yes}}
  
 
==== Suppress "GB" ====
 
==== Suppress "GB" ====
Line 21: Line 21:
  
 
Example:
 
Example:
* {{tld|GBP|123.45|3=long=no}} → {{GBP|123.45|long=no}}
+
* {{tlc|GBP|123.45|3=long=no}} → {{GBP|123.45|long=no}}
  
 
=== Inflation calculation ===
 
=== Inflation calculation ===
Line 33: Line 33:
  
 
Examples:
 
Examples:
* {{tld|GBP|100|{{#expr:{{Inflation/UK/startyear}}-1}}}} → {{GBP|100|{{#expr:{{Inflation/UK/startyear}}-1}}}}
+
* {{tlc|GBP|100|{{#expr:{{Inflation/UK/startyear}}-1}}}} → {{GBP|100|{{#expr:{{Inflation/UK/startyear}}-1}}}}
* {{tld|GBP|100|{{Inflation/UK/startyear}}}} → {{GBP|100|{{Inflation/UK/startyear}}}}
+
* {{tlc|GBP|100|{{Inflation/UK/startyear}}}} → {{GBP|100|{{Inflation/UK/startyear}}}}
* {{tld|GBP|100|1966}} → {{GBP|100|1966}}
+
* {{tlc|GBP|100|1966}} → {{GBP|100|1966}}
* {{tld|GBP|100|1966|4=link=yes}} → {{GBP|100|1966|link=yes}}
+
* {{tlc|GBP|100|1966|4=link=yes}} → {{GBP|100|1966|link=yes}}
* {{tld|GBP|100|{{#expr:{{Inflation/year|UK}}-1}}}} → {{GBP|100|{{#expr:{{Inflation/year|UK}}-1}}}}
+
* {{tlc|GBP|100|{{#expr:{{Inflation/year|UK}}-1}}}} → {{GBP|100|{{#expr:{{Inflation/year|UK}}-1}}}}
* {{tld|GBP|100|{{Inflation/year|UK}}}} → {{GBP|100|{{Inflation/year|UK}}}}
+
* {{tlc|GBP|100|{{Inflation/year|UK}}}} → {{GBP|100|{{Inflation/year|UK}}}}
* {{tld|GBP|100|{{CURRENTYEAR}}}} → {{GBP|100|{{CURRENTYEAR}}}}
+
* {{tlc|GBP|100|{{CURRENTYEAR}}}} → {{GBP|100|{{CURRENTYEAR}}}}
* {{tld|GBP|100|{{#expr:{{CURRENTYEAR}}+1}}}} → {{GBP|100|{{#expr:{{CURRENTYEAR}}+1}}}}
+
* {{tlc|GBP|100|{{#expr:{{CURRENTYEAR}}+1}}}} → {{GBP|100|{{#expr:{{CURRENTYEAR}}+1}}}}
  
 
Additional parameter {{para|about|yes}} will cause the template to calculate to the nearest pound (instead of the nearest penny), and prefix the calculated value with "about". The rounding can be fine-tuned further by using {{para|round|{{var|integer}}}}. These parameters may be combined.
 
Additional parameter {{para|about|yes}} will cause the template to calculate to the nearest pound (instead of the nearest penny), and prefix the calculated value with "about". The rounding can be fine-tuned further by using {{para|round|{{var|integer}}}}. These parameters may be combined.
  
 
Examples:
 
Examples:
* {{tld|GBP|10|1990}} → {{GBP|10|1990}}
+
* {{tlc|GBP|10|1990}} → {{GBP|10|1990}}
* {{tld|GBP|10|1990|4=round=0}} → {{GBP|10|1990|round=0}}
+
* {{tlc|GBP|10|1990|4=round=0}} → {{GBP|10|1990|round=0}}
* {{tld|GBP|10|1990|4=about=yes}} → {{GBP|10|1990|about=yes}}
+
* {{tlc|GBP|10|1990|4=about=yes}} → {{GBP|10|1990|about=yes}}
* {{tld|GBP|1000|1990|4=round=2}} → {{GBP|1000|1990|round=2}}
+
* {{tlc|GBP|1000|1990|4=round=2}} → {{GBP|1000|1990|round=2}}
* {{tld|GBP|1000|1990|4=round=-2}} → {{GBP|1000|1990|round=-2}}
+
* {{tlc|GBP|1000|1990|4=round=-2}} → {{GBP|1000|1990|round=-2}}
* {{tld|GBP|1000|1990|4=round=-2|5=about=yes}} → {{GBP|1000|1990|round=-2|about=yes}}
+
* {{tlc|GBP|1000|1990|4=round=-2|5=about=yes}} → {{GBP|1000|1990|round=-2|about=yes}}
  
 
== Redirects here ==
 
== Redirects here ==
Line 72: Line 72:
  
 
<includeonly>{{Sandbox other||
 
<includeonly>{{Sandbox other||
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
+
<!-- Categories below this line; interwikis at Wikidata -->
 
{{DEFAULTSORT:GBP}}  
 
{{DEFAULTSORT:GBP}}  
 
[[Category:United Kingdom currency templates]]
 
[[Category:United Kingdom currency templates]]

Latest revision as of 00:01, 10 August 2020

This is a multifunction template. At its simplest, it adds the currency mark "GB£", as recommended by MOS:CURRENCY for many situations. The template can also link to the Pound sterling article and can even calculate inflation. See warnings below.

Usage

{{GBP|value}}

Example:

  • {{GBP}}GB£
  • {{GBP|123.45}}GB£123.45

Link

The parameter |link=yes may be used to link to the article Pound sterling. This is turned off by default, but may be appropriate for the first occurrence of the term in an article.

Example:

  • {{GBP|123.45|link=yes}}GB£123.45

Suppress "GB"

By specifying |long=no, display of "GB" before the "£" sign may be suppressed when it is clear from context that the Pound Sterling is meant, rather than other currencies that use £ the symbol.

Example:

  • {{GBP|123.45|long=no}}£123.45

Inflation calculation

The template supports inflation calculation, by way of {{Inflation}}. If the second parameter is used, to specify a year, and this year is within a certain range of available inflation data (specifically, if 1209 ≤ year < 2019), the equivalent value represented in 2019 pound will be calculated in parentheses. However, this function should only be used in appropriate situations.

  • {{GBP|value|year}}
  • {{GBP|value|year|round=round|about=yes}}

Examples:

  • {{GBP|100|1208}}GB£100
  • {{GBP|100|1209}}GB£100 (equivalent to £141,933 in 2019)
  • {{GBP|100|1966}}GB£100 (equivalent to £1,876 in 2019)
  • {{GBP|100|1966|link=yes}}GB£100 (equivalent to £1,876 in 2019)
  • {{GBP|100|2018}}GB£100 (equivalent to £102.56 in 2019)
  • {{GBP|100|2019}}GB£100
  • {{GBP|100|2025}}GB£100
  • {{GBP|100|2026}}GB£100

Additional parameter |about=yes will cause the template to calculate to the nearest pound (instead of the nearest penny), and prefix the calculated value with "about". The rounding can be fine-tuned further by using |round=integer. These parameters may be combined.

Examples:

  • {{GBP|10|1990}}GB£10 (equivalent to £22.9 in 2019)
  • {{GBP|10|1990|round=0}}GB£10 (equivalent to £23 in 2019)
  • {{GBP|10|1990|about=yes}}GB£10 (equivalent to about £23 in 2019)
  • {{GBP|1000|1990|round=2}}GB£1,000 (equivalent to £2,289.57 in 2019)
  • {{GBP|1000|1990|round=-2}}GB£1,000 (equivalent to £2,300 in 2019)
  • {{GBP|1000|1990|round=-2|about=yes}}GB£1,000 (equivalent to about £2,300 in 2019)

Redirects here

See also