Difference between revisions of "User:Natemckn/sandbox3"
m |
m (Sandboxing category) |
||
(4 intermediate revisions by one other user not shown) | |||
Line 6: | Line 6: | ||
float:left; | float:left; | ||
line-height:{{{height|12px}}}; | line-height:{{{height|12px}}}; | ||
− | ">{{#expr:floor({{formatnum:{{{1|<noinclude>3</noinclude>0}}}|R}} / {{formatnum:{{{total|100}}}|R}} * 100)}}% {{{text1|}}} | + | ">{{#expr:floor({{formatnum:{{{1|<noinclude>3</noinclude>0}}}|R}} / {{formatnum:{{{total|100}}}|R}} * 100)}}% {{{text1|}}}</span><!-- |
--><span style=" | --><span style=" | ||
width:{{#if:{{{section2|}}}|{{#expr: {{formatnum:{{{section2}}}|R}} / {{formatnum:{{{total|100}}}|R}} * 100}}%|{{#expr: 100 - {{formatnum:{{{1|<noinclude>3</noinclude>0}}}|R}} / {{formatnum:{{{total|100}}}|R}} * 100}}%}}; | width:{{#if:{{{section2|}}}|{{#expr: {{formatnum:{{{section2}}}|R}} / {{formatnum:{{{total|100}}}|R}} * 100}}%|{{#expr: 100 - {{formatnum:{{{1|<noinclude>3</noinclude>0}}}|R}} / {{formatnum:{{{total|100}}}|R}} * 100}}%}}; | ||
Line 13: | Line 13: | ||
float:left; | float:left; | ||
line-height:{{{height|12px}}}; | line-height:{{{height|12px}}}; | ||
− | ">{{#if:{{{section2|}}}|{{#expr:floor( {{formatnum:{{{section2}}}|R}} / {{formatnum:{{{total|100}}}|R}} * 100)}} % {{{text2|}}} | + | ">{{#if:{{{section2|}}}|{{#expr:floor( {{formatnum:{{{section2}}}|R}} / {{formatnum:{{{total|100}}}|R}} * 100)}}% {{{text2|}}}| }}</span><!-- |
--></div><noinclude> | --></div><noinclude> | ||
{{Template doc}} | {{Template doc}} | ||
− | [[Category:Templates|Percentage bar]] | + | <!--[[Category:Templates|Percentage bar]]--> |
</noinclude> | </noinclude> |
Latest revision as of 22:13, 10 October 2011
This template creates an awesome status bar representing the completion percent of anything. By default this template assumes that the bar goes from 0% to 100%, so in use:
{{User:Natemckn/sandbox3|25}}
generates:
However the top end can be overridden by specifying the total argument, so in this case:
{{User:Natemckn/sandbox3|25|total=200}}
generates:
As 25 of 200 is 12%, rounded.
You can also add text inside the status bar using "text1"
{{User:Natemckn/sandbox3|25 |text1=completed |total=200}}
generates:
You can also control the light shaded section and add text to it
{{User:Natemckn/sandbox3|20 |text1 = done with thing 1 |section2 = 30 |text2 = done with thing 2 |total = 80}}generates: