Template:CAD

From blackwiki
Revision as of 17:11, 3 April 2013 by imported>Ryulong
Jump to navigation Jump to search

50px Template documentation[view] [edit] [history] [purge]

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

Usage

{{CAD|number}}

Additional text like "million" or "trillion" must be placed outside the template, typically preceded by a non-breaking space (see example below).

Example:

  • {{CAD}}CAD
  • {{CAD|123.45}}CAD 123.45
  • {{CAD|123}}{{nbsp}}millionCAD 123 million

Link

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

Example:

  • {{CAD|123.45|link=yes}}C$ 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 1914 ≤ year < 2018), the equivalent value represented in 2018 dollars will be calculated in parentheses. However, this function should only be used in appropriate situations.

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

Examples:

  • {{CAD|100|1913}}CAD 100 ($Error when using {{Inflation}}: NaN, check parameters for non-numeric data: |r=Expression error: Unexpected < operator.. in 2026)
  • {{CAD|100|1914}}CAD 100 ($2,223 in 2026)
  • {{CAD|100|1966}}CAD 100 ($762.29 in 2026)
  • {{CAD|100|1966|link=yes}}C$ 100 ($762.29 in 2026)
  • {{CAD|100|2017}}CAD 100 ($102.3 in 2026)
  • {{CAD|100|2018}}CAD 100 ($100 in 2026)
  • {{CAD|100|2026}}CAD 100
  • {{CAD|100|2027}}CAD 100

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

Examples:

  • {{CAD|10|1935}}CAD 10 ($182.74 in 2026)
  • {{CAD|10|1935|round=0}}CAD 10 ($183 in 2026)
  • {{CAD|10|1935|about=yes}}CAD 10 (about $183 in 2026)
  • {{CAD|1000|1935|round=2}}CAD 1,000 ($18,273.97 in 2026)
  • {{CAD|1000|1935|round=-2}}CAD 1,000 ($18,300 in 2026)
  • {{CAD|1000|1935|round=-2|about=yes}}CAD 1,000 (about $18,300 in 2026)

Redirects here

See also