Template:Progression: Difference between revisions
More actions
Created page with "<includeonly><templatestyles src="Progression/styles.css"/><table role="presentation" class="progression" {{#if:{{{width|}}}|style="width: {{{width}}}"}}> <tr> <td class="progression-header">{{#if:{{{task|}}}|{{{task|}}}: }}<span>{{formatnum:{{#if:{{#if:{{{1|}}}|{{{1}}}|0}}|{{#expr:100*{{#if:{{{1|}}}|{{{1}}}|0}}/{{{2|{{{total|100}}}}}}round {{{decimal|1}}}}}}}}}%</span>{{#if:{{yesno|{{{hidecomplete|}}}}}|| complete}} </td></tr> <tr><td><table role="progressbar" c..." |
No edit summary |
||
| Line 1: | Line 1: | ||
<includeonly><templatestyles src="Progression/styles.css"/><table role="presentation" class="progression" {{#if:{{{width|}}}|style="width: {{{width}}}"}}> | <includeonly><templatestyles src="Template:Progression/styles.css"/><table role="presentation" class="progression" {{#if:{{{width|}}}|style="width: {{{width}}}"}}> | ||
<tr> | <tr> | ||
<td class="progression-header">{{#if:{{{task|}}}|{{{task|}}}: }}<span>{{formatnum:{{#if:{{#if:{{{1|}}}|{{{1}}}|0}}|{{#expr:100*{{#if:{{{1|}}}|{{{1}}}|0}}/{{{2|{{{total|100}}}}}}round {{{decimal|1}}}}}}}}}%</span>{{#if:{{yesno|{{{hidecomplete|}}}}}|| complete}} | <td class="progression-header">{{#if:{{{task|}}}|{{{task|}}}: }}<span>{{formatnum:{{#if:{{#if:{{{1|}}}|{{{1}}}|0}}|{{#expr:100*{{#if:{{{1|}}}|{{{1}}}|0}}/{{{2|{{{total|100}}}}}}round {{{decimal|1}}}}}}}}}%</span>{{#if:{{yesno|{{{hidecomplete|}}}}}|| complete}} | ||
Latest revision as of 02:30, 19 February 2025
| This template uses TemplateStyles: |
Syntax
{{Progression|percent}}
The percent is a number between 0 and 100, without the trailing %.
Optionally, the decimal parameter will set the number of decimal places to be rounded. If not specified, defaults to 1.
{{Progression|param1|param2}}
Calculates the progression as a function of param1/param2
{{Progression|param1|param2|task=param3}}
Calculates the progression as a function of param1/param2, and displays a task label on the bar.
Examples
1 parameter (percent)
{{Progression|0}} :
| 0% complete | |
{{Progression|0.5}} :
| 0.5% complete | ||
{{Progression|1}} :
| 1% complete | ||
{{Progression|36.7}} :
| 36.7% complete | ||
{{Progression|100}} :
| 100% complete | |
2 parameters
{{Progression|0|250}} :
| 0% complete | |
{{Progression|100|250}} :
| 40% complete | ||
{{Progression|200|300}} :
| 66.7% complete | ||
{{Progression|300|300}} :
| 100% complete | |
3 parameters
{{Progression|0|250|task=Sorting articles}} :
| Sorting articles: 0% complete | |
{{Progression|100|250|task=Sorting articles}} :
| Sorting articles: 40% complete | ||
TemplateData
TemplateData for Progression
The template is used to create a progression bar.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| value | 1 | The current value of the progression. | Number | suggested |
| max value | 2 total | The total value of the progression bar
| Number | optional |
| width | width | The CSS width of the progression bar. Unit is required.
| String | optional |
| task | task | The name displayed before the value.
| Line | optional |
| decimal | decimal | The decimal to be rounded to | Number | optional |
| hide complete | hidecomplete | Whether hide the display of number of completion.
| Boolean | optional |