Jump to content

Template:Percentage: Difference between revisions

From cernipedia
examples should actually use the template
m 33 revisions imported from wikipedia:Template:Percentage
 
(29 intermediate revisions by 13 users not shown)
Line 1: Line 1:
<includeonly>{{#expr: {{{1}}}/{{{2}}}*100 round {{#ifeq: {{#expr: {{{3}}} >= 0 }} | 1 | {{{3}}} | 0 }} }}%</includeonly><noinclude>
<includeonly>{{safesubst:<noinclude/>#invoke:Percentage|main|{{{1|0}}}|{{{2|100}}}|{{{3|}}}|pad={{{pad|}}}|sigfig={{{sigfig|}}}|%={{{%|%}}}|nonscinote={{{nonscinote|}}}
 
}}</includeonly><noinclude>
;Usage: <nowiki>{{</nowiki>Pct| ''numerator'' | ''denominator'' | ''decimals to round to (zero or greater)'' }}
{{documentation}}
 
;Examples:
* <nowiki>{{Pct | 1 | 3 | 3 }}</nowiki> yields {{Pct | 1 | 3 | 3 }}
* <nowiki>{{Pct | 2 | 10 | 3 }}</nowiki> yields {{Pct | 2 | 10 | 3 }}
[[Category:Mathematical function templates|Pct]]
 
</noinclude>
</noinclude>

Latest revision as of 13:13, 19 November 2026