Template:Progression: Difference between revisions

From Portals of Phereon Wiki
Content added Content deleted
portalsofphereon>Olaroll
No edit summary
m (6 revisions imported)
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
<includeonly><table width={{#if:{{{width|}}}|{{{width|}}}|50%}} align=center style="background:transparent">
<includeonly>{| style="width: {{ #if: {{{width|}}} | {{{width}}} | 50% }}; margin: auto; background: transparent; text-align: center;"
| {{ #if: {{{task|}}} | {{{task|}}}:&#32; }}<big>'''{{ formatnum: {{ #if: {{{1|}}} | {{ #expr: 100 * {{{1}}} / {{{2|100}}} round 1 }} | 0 }} }}%'''</big> complete
<tr>
|-
<td align=center>{{#if:{{{task|}}}|{{{task|}}}:&nbsp;}}<!--T:1--> <big>'''<tvar|1>{{formatnum:{{#if:{{{1|}}}|{{#expr:100*{{{1}}}/{{{2|100}}}round 1}}|0}}}}</>%'''</big> complete</td>
|
</tr>
{| style="border: 1px solid black; width: 100%; {{ #if: {{{height|}}} | height: {{{height}}}px; }}" cellspacing="1"
<tr>
{{ #ifeq: {{ #if: {{{1|}}} | {{{1}}} | 0 }} | 0 || {{!}} style="background: #5FDB00; width: {{ #ifexpr: ( {{ #if: {{{1|}}} | {{ #expr: 100 * {{{1}}} / {{{2|100}}} }} | 0 }} < 1 ) | 1% | {{ #if: {{{1|}}} | {{ #expr: 100 * {{{1}}} / {{{2|100}}} round 1 }} | 0 }}% }};" {{!}} }}
<td>
{{ #ifeq: {{ #if: {{{1|}}} | {{ #expr: 100 * {{{1}}} / {{{2|100}}} }} | 0 }} | 100 || {{!}} style="background: #E2E2E2;" {{!}} }}
<table style="border:1px solid gray" cellspacing=1 width=100% height=15x>
|}
<tr>
|}</includeonly><noinclude>{{documentation}}</noinclude>
{{#ifeq:{{#if:{{{1|}}}|{{{1}}}|0}}|0| | <td style="background:#5FDB00; width:{{#ifexpr:({{#if:{{{1|}}}|{{#expr:100*{{{1}}}/{{{2|100}}}}}|0}}<1)|1%|{{#if:{{{1|}}}|{{#expr:100*{{{1}}}/{{{2|100}}}round 1}}|0}}%}}">&nbsp;</td> }}
{{#ifeq:{{#if:{{{1|}}}|{{#expr:100*{{{1}}}/{{{2|100}}}}}|0}}|100|| <td style="background:#E2E2E2">&nbsp;</td> }}
</tr>
</table></td>
</tr>
</table>
}}</includeonly><noinclude>{{Documentation}}
</noinclude>

Latest revision as of 18:52, 12 December 2020

[view | edit | purge]Documentation

Syntax[]

{{Progression|percent}}

The percent is a number between 0 and 100, without the trailing %.

{{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
[view | edit | purge]The above documentation is transcluded fromTemplate:Progression/doc.