Template:Percentage bar: Difference between revisions

From PZwiki
m (rm {{underconstruction}})
m (Automated Formatting)
 
Line 9: Line 9:
{{tll|Percentage bar|50|total{{=}}200}}
{{tll|Percentage bar|50|total{{=}}200}}
{{Percentage bar|50|total=200}}
{{Percentage bar|50|total=200}}
==Attribution==
==Attribution==
[https://wiki.teamfortress.com/wiki/Template:Percentage_bar Team fortress 2 wiki]
[https://wiki.teamfortress.com/wiki/Template:Percentage_bar Team fortress 2 wiki]
}}
}}
</noinclude><includeonly><div style="display:none">{{#expr: {{formatnum:{{{1|0}}}|R}} / {{formatnum:{{{total|100}}}|R}}}}</div><!-- Sort key
</noinclude><includeonly><div style="display:none">{{#expr: {{formatnum:{{{1|0}}}|R}} / {{formatnum:{{{total|100}}}|R}}}}</div><!-- Sort key
--><div class="percentage-bar" style="border:{{{border|1px solid #68191b}}}; padding:{{{padding|1px}}}; overflow:hidden; width:{{{width|50%}}}; margin: none; font-size:xx-small; text-align:right; {{{style|}}}"><!--  
--><div class="percentage-bar" style="border:{{{border|1px solid #68191b}}}; padding:{{{padding|1px}}}; overflow:hidden; width:{{{width|50%}}}; margin: none; font-size:xx-small; text-align:right; {{{style|}}}"><!--
   --><span class="percentage-bar--progress" style="
   --><span class="percentage-bar--progress" style="
     width: {{#expr: {{formatnum:{{{1|<noinclude>3</noinclude>0}}}|R}} / {{formatnum:{{{total|100}}}|R}} * 100}}%;
     width: {{#expr: {{formatnum:{{{1|<noinclude>3</noinclude>0}}}|R}} / {{formatnum:{{{total|100}}}|R}} * 100}}%;
Line 21: Line 22:
     line-height:{{{height|12px}}};
     line-height:{{{height|12px}}};
     {{{style1|}}}
     {{{style1|}}}
     ">{{#expr:floor({{formatnum:{{{1|<noinclude>3</noinclude>0}}}|R}} / {{formatnum:{{{total|100}}}|R}} * 100)}}%&nbsp;</span><!--  
     ">{{#expr:floor({{formatnum:{{{1|<noinclude>3</noinclude>0}}}|R}} / {{formatnum:{{{total|100}}}|R}} * 100)}}%&nbsp;</span><!--
   --><span style="
   --><span style="
     width:{{#expr: 100 - {{formatnum:{{{1|<noinclude>3</noinclude>0}}}|R}} / {{formatnum:{{{total|100}}}|R}} * 100}}%;
     width:{{#expr: 100 - {{formatnum:{{{1|<noinclude>3</noinclude>0}}}|R}} / {{formatnum:{{{total|100}}}|R}} * 100}}%;
Line 31: Line 32:
     float:left;
     float:left;
     {{{style2|}}}
     {{{style2|}}}
     ">&nbsp;</span><!--  
     ">&nbsp;</span><!--
   --></div></includeonly>
   --></div></includeonly>

Latest revision as of 14:24, 14 April 2024

Notebook.pngTemplate Documentation

This template is used to show a percentage as a bar. By default the parameter given is a percentage out of 100, but the total can be changed by giving the parameter total=X where X is the total number.

Usage

{{Percentage bar|50}}

0.5
50%  

{{Percentage bar|50|total=200}}

0.25
25%  

Attribution

Team fortress 2 wiki

Editors can experiment in this template's sandbox.