Open main menu

Changes

m
{{Documentation subpage}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->

This is a multifunction template. At its simplest, it adds the currency mark "US$", as recommended by [[MOS:CURRENCY]] for many situations. The template can also link to the [[United States dollar]] article and can even calculate inflation. <em>See warnings below.</em>

== Usage ==
{{tlxi|US$|value}}

Example:
* {{tld|US$}} → {{US$}}
* {{tld|US$|123.45}} → {{US$|123.45}}

==== Link ====
The parameter {{para|link|yes}} may be used to link US$ to the article [[United States dollar]]. This is turned off by default, but may be appropriate for the first occurrence of the term in an article.

Example:
* {{tld|US$|123.45|3=link=yes}} → {{US$|123.45|link=yes}}

==== Suppress "US" ====
By specifying {{para|long|no}}, display of "US" before the "$" sign may be suppressed when it is clear from context that the [[United States dollar]] is meant, rather than one of the twenty or so other currencies going by the name of "[[dollar]]".

Examples:
* {{tld|US$|123.45|3=long=no}} → {{US$|123.45|long=no}}
* {{tld|US$|123.45|3=long=no|4=link=yes}} → {{US$|123.45|long=no|link=yes}}

==== 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: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|US}} 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/US/startyear}} ≤ <code>{{var|year}}</code> < {{Inflation/year|US}}}}), the equivalent value represented in {{Inflation/year|US}} dollars will be calculated in parentheses. However, this function should only be used in appropriate situations.

* {{tlxi|US$|value|year}}
* {{tlx|US$|{{var|value}}|{{var|year}}|4=round={{var|round}}|5=about=yes}}

Examples:
* {{tld|US$|100|{{#expr:{{Inflation/US/startyear}}-1}}}} → {{US$|100|{{#expr:{{Inflation/US/startyear}}-1}}}}
* {{tld|US$|100|{{Inflation/US/startyear}}}} → {{US$|100|{{Inflation/US/startyear}}}}
* {{tld|US$|100|1966}} → {{US$|100|1966}}
* {{tld|US$|100|1966|4=link=yes}} → {{US$|100|1966|link=yes}}
* {{tld|US$|100|{{#expr:{{Inflation/year|US}}-1}}}} → {{US$|100|{{#expr:{{Inflation/year|US}}-1}}}}
* {{tld|US$|100|{{Inflation/year|US}}}} → {{US$|100|{{Inflation/year|US}}}}
* {{tld|US$|100|{{CURRENTYEAR}}}} → {{US$|100|{{CURRENTYEAR}}}}
* {{tld|US$|100|{{#expr:{{CURRENTYEAR}}+1}}}} → {{US$|100|{{#expr:{{CURRENTYEAR}}+1}}}}

Additional parameter {{para|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 {{para|round|{{var|integer}}}}. These parameters may be combined.

Examples:
* {{tld|US$|10|1935}} → {{US$|10|1935}}
* {{tld|US$|10|1935|4=round=0}} → {{US$|10|1935|round=0}}
* {{tld|US$|10|1935|4=about=yes}} → {{US$|10|1935|about=yes}}
* {{tld|US$|1000|1935|4=round=2}} → {{US$|1000|1935|round=2}}
* {{tld|US$|1000|1935|4=round=-2}} → {{US$|1000|1935|round=-2}}
* {{tld|US$|1000|1935|4=round=-2|5=about=yes}} → {{US$|1000|1935|round=-2|about=yes}}

== Redirects here ==
* [[Template:USD]]

== See also ==
* [[Wikipedia:Manual of Style (dates and numbers)#Currencies]]
* [[Template:Currency]]
* [[Wikipedia:Wikiproject United States]]
* [[Template:AUD]]
* [[Template:BDT]]
* [[Template:CAD]]
* [[Template:CNY]]
* [[Template:GB£]]
* [[Template:INR]]
* [[Template:JPY]]
* [[Template:Philippine peso]]
* [[Template:PKR]]

<includeonly>
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
{{DEFAULTSORT:USD}}
[[Category:United States economic templates]]
[[Category:Currency templates]]
[[Category:Currencies of the United States|τ]]
[[Category:Unit indicator templates]]
</includeonly>
Anonymous user