Difference between revisions of "Template:%"
Jump to navigation
Jump to search
(Used) |
m (Changed protection level for "Template:%": protection no longer required ([Edit=Allow only autoconfirmed users] (expires 20:18, 1 February 2023 (UTC)) [Move=Allow only autoconfirmed users] (expires 20:18, 1 February 2023 (UTC)))) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | <includeonly>{{#expr:{{{1}}}*100}}%</includeonly><noinclude>{{Documentation}}</noinclude> | + | <includeonly>{{#expr:({{{1|}}})*100 {{#if:{{{2|}}}|round{{{2|}}}}} }}%</includeonly><noinclude>{{Documentation}}</noinclude> |
Latest revision as of 19:18, 1 February 2023
Usage[edit]
This template can be used to convert numbers into percentages.
The template has two parameters:
- The first parameter is the value that will be converted into a percentage and can be any number or expression. This parameter is mandatory.
- The second parameter controls the number of digits after the decimal point and needs to be an integer. This parameter is optional.
Examples[edit]
{{%|0.357}}
would produce: 35.7%
{{%|0.357|0}}
would produce: 36%
{{%|{{Q|Barricade|Cover Effectiveness}}}}
would produce: 55%
{{%|1-{{Q|Barricade|Cover Effectiveness}}}}
would produce: 45%
The above documentation is transcluded from Template:%/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |