Template:Format price
(Redirected from Template:Formatprice)
Jump to navigation
Jump to search
[edit] [ ]
Template documentation

This template display numbers typically representing prices in a pleasant way, ideally suited for articles. Numbers one thousand or greater are reduced down and rounded to a total of three digits followed by a multiplier text, and smaller numbers received separators and exactly two digits to represent cents, what doesn't always happen with the {{formatnum:}} magic word.
Usage
{{Formatprice|value|digits}}
Where:
- value – the value that will be formatted and displayed (required).
- digits – sets the digit in which a value lower than one thousand must be rounded, defaulting to "2" (cents) if unspecified.
Providing non-numeric parameters, failing to provide any parameter, or providing a negative value parameter, result all in a link to the NaN article.
Examples
{{Formatprice|1.2}} = 1.20
{{Formatprice|456.789}} = 456.79
{{Formatprice|456.789|1}} = 456.80
{{Formatprice|456.789|0}} = 457
{{Formatprice|456.789|-2}} = 500
${{Formatprice|1234}} = $1.23 thousand
${{Formatprice|12345}} = $12.3 thousand
${{Formatprice|123456}} = $123 thousand
${{Formatprice|1000000}} = $1 million
¥{{Formatprice|98765432109876}} = ¥98.8 trillion
{{Formatprice|7.86178E+25}} atoms = 78.6 septillion atoms
{{Formatprice}} = NaN
{{Formatprice||0}} = NaN
{{Formatprice|-100}} = NaN
{{Formatprice|xyz|A}} = NaN
See also
- {{Inflation}}
- {{Inflation-fn}}
The above documentation is transcluded from Template:Format price/doc. (edit | history) Editors can experiment in this template's sandbox (create) and testcases (create) pages. Please add categories and interwikis to the /doc subpage. Subpages of this template. |