Template:GBP/doc

From the AARoads Wiki: Read about the road before you go
Jump to navigation Jump to search

This is a multifunction template. At its simplest, it adds the currency mark "£". The template can also link to the Pound sterling article and can even calculate inflation. See warnings below.

Usage

{{GBP|value}}

Example:

  • {{GBP}}£
  • {{GBP|123.45}}£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}}£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 < 2023), the equivalent value represented in 2023 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}}£100
  • {{GBP|100|1209}}£100 (equivalent to £177,967 in 2023)
  • {{GBP|100|1966}}£100 (equivalent to £2,353 in 2023)
  • {{GBP|100|1966|link=yes}}£100 (equivalent to £2,353 in 2023)
  • {{GBP|100|2022}}£100 (equivalent to £106.41 in 2023)
  • {{GBP|100|2023}}£100
  • {{GBP|100|2024}}£100
  • {{GBP|100|2025}}£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}}£10 (equivalent to £28.71 in 2023)
  • {{GBP|10|1990|round=0}}£10 (equivalent to £29 in 2023)
  • {{GBP|10|1990|about=yes}}£10 (equivalent to about £29 in 2023)
  • {{GBP|1000|1990|round=2}}£1,000 (equivalent to £2,870.84 in 2023)
  • {{GBP|1000|1990|round=-2}}£1,000 (equivalent to £2,900 in 2023)
  • {{GBP|1000|1990|round=-2|about=yes}}£1,000 (equivalent to about £2,900 in 2023)

Redirects here

TemplateData

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:GBP in articles based on its TemplateData.

TemplateData for GBP

<templatedata> { "params": { "1": { "label": "Amount", "description": "The monetary value. Preferably in numeric value.", "example": "10000.00", "type": "number" }, "2": { "aliases": [ "year" ], "label": "Year", "description": "The year which the monetary value was recorded", "example": "2010", "type": "number" }, "link": { "label": "Display currency article", "description": "To display Pound sterling article. 'on' will display the link.", "example": "on", "type": "string" }, "long": { "label": "Display \"GB\" before the \"£\" sign?", "example": "no", "type": "string", "suggestedvalues": [ "yes","no" ] }, "about": { "label": "Calculate to nearest pound", "description": "Calculate to nearest pound", "example": "yes", "type": "string" }, "round": { "label": "Rounding", "description": "Number of integers to round the value to.", "example": "2", "type": "number" } }, "description": "This template renders the standard British Pound sterling currency abbreviation (£) and an optional value. The abbreviation provides an informative link to the currency article and can even calculate inflation." } </templatedata>

See also