Difference between revisions of "Template:CAD/doc"

From blackwiki
Jump to navigation Jump to search
imported>Daask
imported>Jdaloner
m ("{{Inflation-year" --> "{{Inflation/year")
Line 19: Line 19:
 
=== Inflation calculation ===
 
=== Inflation calculation ===
 
{{ombox |type= content |imageright= [[File:Emblem-money.svg|42px]] |text= This template is <strong>only capable</strong> of inflating Consumer Price Index values: staples, workers' rent, small service bills (doctor's costs, train tickets). This template is <strong>incapable</strong> of inflating capital expenses, government expenses, or the personal wealth and expenditure of the rich. <strong>Incorrect use of this template would constitute original research. If you yourself do not have economic training, then please consult someone who does before using this template.</strong>}}
 
{{ombox |type= content |imageright= [[File:Emblem-money.svg|42px]] |text= This template is <strong>only capable</strong> of inflating Consumer Price Index values: staples, workers' rent, small service bills (doctor's costs, train tickets). This template is <strong>incapable</strong> of inflating capital expenses, government expenses, or the personal wealth and expenditure of the rich. <strong>Incorrect use of this template would constitute original research. If you yourself do not have economic training, then please consult someone who does before using this template.</strong>}}
{{ombox |type= content |imageright= [[File:Current event warning.svg|42px]] |text= <strong>Do not assume that using this template will mean that a calculated value is <em>"current"</em></strong>, <em>"as of {{CURRENTYEAR}}"</em>, <em>"as of {{#expr:{{CURRENTYEAR}}-1}}"</em> or even necessarily <em>"recent"</em>. Do not use <code><nowiki>{{CURRENTYEAR}}</nowiki></code> to refer to calculated value, instead {{tlx|Inflation-year|CA}} may be used. See also [[MOS:REALTIME]].}}
+
{{ombox |type= content |imageright= [[File:Current event warning.svg|42px]] |text= <strong>Do not assume that using this template will mean that a calculated value is <em>"current"</em></strong>, <em>"as of {{CURRENTYEAR}}"</em>, <em>"as of {{#expr:{{CURRENTYEAR}}-1}}"</em> or even necessarily <em>"recent"</em>. Do not use <code><nowiki>{{CURRENTYEAR}}</nowiki></code> to refer to calculated value, instead {{tlx|Inflation/year|CA}} may be used. See also [[MOS:REALTIME]].}}
  
The template supports inflation calculation, by way of {{tlx|Inflation}}. If the second parameter is used, to specify a year, and this year is within a certain range of available inflation data (specifically, {{nowrap|if {{Inflation/CA/startyear}} ≤ <code>{{var|year}}</code> < {{Inflation-year|CA}}}}), the equivalent value represented in {{Inflation-year|CA}} dollars will be calculated in parentheses. However, this function should only be used in appropriate situations.
+
The template supports inflation calculation, by way of {{tlx|Inflation}}. If the second parameter is used, to specify a year, and this year is within a certain range of available inflation data (specifically, {{nowrap|if {{Inflation/CA/startyear}} ≤ <code>{{var|year}}</code> < {{Inflation/year|CA}}}}), the equivalent value represented in {{Inflation/year|CA}} dollars will be calculated in parentheses. However, this function should only be used in appropriate situations.
  
 
* {{tlxi|CA$|value|year}}
 
* {{tlxi|CA$|value|year}}
Line 31: Line 31:
 
* {{tld|CA$|100|1966}} → {{CA$|100|1966}}
 
* {{tld|CA$|100|1966}} → {{CA$|100|1966}}
 
* {{tld|CA$|100|1966|4=link=yes}} → {{CA$|100|1966|link=yes}}
 
* {{tld|CA$|100|1966|4=link=yes}} → {{CA$|100|1966|link=yes}}
* {{tld|CA$|100|{{#expr:{{Inflation-year|CA}}-1}}}} → {{CA$|100|{{#expr:{{Inflation-year|CA}}-1}}}}
+
* {{tld|CA$|100|{{#expr:{{Inflation/year|CA}}-1}}}} → {{CA$|100|{{#expr:{{Inflation/year|CA}}-1}}}}
* {{tld|CA$|100|{{Inflation-year|CA}}}} → {{CA$|100|{{Inflation-year|CA}}}}
+
* {{tld|CA$|100|{{Inflation/year|CA}}}} → {{CA$|100|{{Inflation/year|CA}}}}
 
* {{tld|CA$|100|{{CURRENTYEAR}}}} → {{CA$|100|{{CURRENTYEAR}}}}
 
* {{tld|CA$|100|{{CURRENTYEAR}}}} → {{CA$|100|{{CURRENTYEAR}}}}
 
* {{tld|CA$|100|{{#expr:{{CURRENTYEAR}}+1}}}} → {{CA$|100|{{#expr:{{CURRENTYEAR}}+1}}}}
 
* {{tld|CA$|100|{{#expr:{{CURRENTYEAR}}+1}}}} → {{CA$|100|{{#expr:{{CURRENTYEAR}}+1}}}}

Revision as of 04:34, 18 October 2018

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

{{CA$|value}}

Example:

  • {{CA$}}CA$
  • {{CA$|123.45}}CA$123.45

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:

  • {{CA$|123.45|link=yes}}CA$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.

  • {{CA$|value|year}}
  • {{CA$|value|year|round=round|about=yes}}

Examples:

  • {{CA$|100|1913}}CA$100
  • {{CA$|100|1914}}CA$100 (equivalent to $2,223 in 2018)
  • {{CA$|100|1966}}CA$100 (equivalent to $762.29 in 2018)
  • {{CA$|100|1966|link=yes}}CA$100 (equivalent to $762.29 in 2018)
  • {{CA$|100|2017}}CA$100 (equivalent to $102.3 in 2018)
  • {{CA$|100|2018}}CA$100
  • {{CA$|100|2025}}CA$100
  • {{CA$|100|2026}}CA$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:

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

Redirects here

See also