Template:Formatprice/doc
外观
| 此頁面是Template:Formatprice的Template文档。 此頁面可能包含了模板的使用說明、分類和其他内容。 |
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千
${{Formatprice|12345}}= $1.23萬
${{Formatprice|123456}}= $12.3萬
${{Formatprice|1000000}}= $100萬
¥{{Formatprice|98765432109876}}= ¥98.8萬億
{{Formatprice|7.86178E+25}}atoms = 78.6秭 atoms
{{Formatprice}}= NaN
{{Formatprice||0}}= NaN
{{Formatprice|-100}}= NaN
{{Formatprice|xyz|A}}= NaN
See also
[编辑]- {{Inflation}}
- {{Inflation-fn}}