模板:Percentage
跳转到导航
跳转到搜索
页面Module:Documentation/styles.css没有内容。
File:Test Template Info-Icon - Version (2).svg 模板文档[查看] [编辑] [历史] [清除缓存]
模板介绍[编辑]
使用方法[编辑]
{{percentage | numerator | denominator | decimals to round to (zero or greater) }}
范例[编辑]
- {{Percentage | 1 | 3 | 0 }} yields 脚本错误:没有“Percentage”这个模块。
- {{Percentage | 1 | 3 | 2 }} yields 脚本错误:没有“Percentage”这个模块。
Negative values can be used:
- {{Percentage | -1 | 3 }} yields 脚本错误:没有“Percentage”这个模块。
Nornal operation is to cut off all decimal zeroes from right in rounding:
- {{Percentage | 1 | 5 | 2 }} yields 脚本错误:没有“Percentage”这个模块。
- {{Percentage | 1111 | 10000 | 4 }} yields 脚本错误:没有“Percentage”这个模块。
Add |pad=yes to always get as many deciamls as specified, padding with zeroes where needed:
- {{Percentage | 1 | 5 | 2 | pad=yes }} yields 脚本错误:没有“Percentage”这个模块。
- {{Percentage | 1111 | 10000 | 4 | pad=yes }} yields 脚本错误:没有“Percentage”这个模块。
Third parameter can also be given through |pad=N:
- {{Percentage | 111 | 1000 | pad=4 }} is same as {{Percentage | 111 | 1000 | 4 | pad=yes }} and yields 脚本错误:没有“Percentage”这个模块。
Default denominator is 100:
- {{Percentage | 20 }} yields 脚本错误:没有“Percentage”这个模块。
- {{Percentage | 20 || pad = 2 }} yields 脚本错误:没有“Percentage”这个模块。
Default precision is zero:
- {{Percentage | 1 | 3 }} yields 脚本错误:没有“Percentage”这个模块。
Truncate result instead of Round (default):
- {{Percentage | 115 | 162 | 2 }} yields 脚本错误:没有“Percentage”这个模块。
- {{Percentage | 115 | 162 | 2 | trunc=yes }} yields 脚本错误:没有“Percentage”这个模块。