Difference between revisions of "Template:Progress bar"
From GATE
(Created page with "<div style=" width:{{{width|75%}}}; {{#ifeq: {{{center|yes}}} | yes | margin:auto; text-align:center;}}"> {{#ifeq: {{{header|yes}}} | yes | <p> '''{{#expr: ( {{{1|<noi...") |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | <div style=" | + | <includeonly><div style=" |
width:{{{width|75%}}}; | width:{{{width|75%}}}; | ||
{{#ifeq: {{{center|yes}}} | yes | | {{#ifeq: {{{center|yes}}} | yes | | ||
Line 7: | Line 7: | ||
| <p> | | <p> | ||
'''{{#expr: ( {{{1|<noinclude>2</noinclude>0}}} / {{{total|100}}}) * 100 round 1}}%''' | '''{{#expr: ( {{{1|<noinclude>2</noinclude>0}}} / {{{total|100}}}) * 100 round 1}}%''' | ||
− | {{{text|completed <small> | + | {{{text|completed <small></small>}}} |
</p> | </p> | ||
}} | }} | ||
Line 24: | Line 24: | ||
"> </span> | "> </span> | ||
</p> | </p> | ||
− | </div> | + | </div></includeonly> |
+ | <noinclude> | ||
+ | Use as follows:<br /> | ||
+ | |||
+ | <code><nowiki>{{Progress_bar|<numeric value>|total=<numeric value>}}</nowiki></code><br /> | ||
+ | |||
+ | E.g.:<br /> | ||
+ | |||
+ | <code><nowiki>{{Progress_bar|14|total=200}}</nowiki></code><br /> | ||
+ | |||
+ | gives this:<br /> | ||
+ | |||
+ | {{Progress_bar|14|total=200}}<br /> | ||
+ | <br /> | ||
+ | |||
+ | Instead of numeric values, it is also possible to insert [[mw:Help:Magic_words#Variables|variables]]. E.g.:<br /> | ||
+ | |||
+ | <code><nowiki>{{Progress_bar|{{formatnum:{{PAGESINCATEGORY:EBC Proofread|all}}|R}}|total={{formatnum:{{PAGESINCATEGORY:EBC Letters|all}}|R}}}}</nowiki></code><br /> | ||
+ | |||
+ | gives this:<br /> | ||
+ | |||
+ | {{Progress_bar|{{formatnum:{{PAGESINCATEGORY:EBC Proofread|all}}|R}}|total={{formatnum:{{PAGESINCATEGORY:EBC Letters|all}}|R}}}}<br /> | ||
+ | |||
+ | Other configurable parameters: | ||
+ | * height = | ||
+ | * width = defaults to 75% | ||
+ | * text = message to display after %; defaults to: completed (estimate) | ||
+ | * total = amount to use as the denominator (instead of 100), allows the template to compute the percentage on the fly | ||
+ | * header = no (or any value other than "yes", which is the default) suppresses the display of the percentage on the top line | ||
+ | </noinclude> |
Latest revision as of 08:31, 16 January 2018
Use as follows:
{{Progress_bar|<numeric value>|total=<numeric value>}}
E.g.:
{{Progress_bar|14|total=200}}
gives this:
7% completed
Instead of numeric values, it is also possible to insert variables. E.g.:
{{Progress_bar|{{formatnum:{{PAGESINCATEGORY:EBC Proofread|all}}|R}}|total={{formatnum:{{PAGESINCATEGORY:EBC Letters|all}}|R}}}}
gives this:
55.2% completed
Other configurable parameters:
- height =
- width = defaults to 75%
- text = message to display after %; defaults to: completed (estimate)
- total = amount to use as the denominator (instead of 100), allows the template to compute the percentage on the fly
- header = no (or any value other than "yes", which is the default) suppresses the display of the percentage on the top line