Jump to content

Template:Progress bar: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
{{large}}
`#expr` inside the test of `#ifexpr` is unnecessary, though you may have to use parentheses to ensure stuff is done in the correct order
 
Line 7: Line 7:
| <p>
| <p>
{{Large|1=
{{Large|1=
'''{{#expr: ( {{{1|<noinclude>2</noinclude>0}}} / {{{total|100}}}) * 100 round {{{decimal|1}}}}}%'''
'''{{#expr: ({{{1|<noinclude>2</noinclude>0}}} / {{{total|100}}}) * 100 round {{{decimal|1}}}}}%'''
}}
}}
{{{text|completed <small>(estimate)</small>}}}
{{{text|completed <small>(estimate)</small>}}}
Line 14: Line 14:
<p style="border:{{{border|1px solid #c8ccd1}}}; padding:{{{padding|1px}}}; overflow:hidden;">
<p style="border:{{{border|1px solid #c8ccd1}}}; padding:{{{padding|1px}}}; overflow:hidden;">
<span style=" <!-- if percentage is higher than 100%, show all green bar -->
<span style=" <!-- if percentage is higher than 100%, show all green bar -->
width: {{#ifexpr: {{#expr:{{{1|0}}}/{{{total|100}}}}}>1 | 100 | {{#expr: {{{1|<noinclude>2</noinclude>0}}} / {{{total|100}}} * 100}}}}%;
width: {{#ifexpr: ({{{1|0}}}/{{{total|100}}})>1 | 100 | {{#expr: {{{1|<noinclude>2</noinclude>0}}} / {{{total|100}}} * 100}}}}%;
height: {{{height|2}}}px;
height: {{{height|2}}}px;
background:{{{color1|#00af32}}};
background:{{{color1|#00af32}}};
Line 20: Line 20:
">&nbsp;</span>
">&nbsp;</span>
<span style=" <!-- if percentage is higher than 100%, show no grey bar -->
<span style=" <!-- if percentage is higher than 100%, show no grey bar -->
width: {{#ifexpr: {{#expr:{{{1|0}}}/{{{total|100}}}}}>1 | 0 | {{#expr: 100 - {{{1|<noinclude>2</noinclude>0}}} / {{{total|100}}} * 100}}}}%;
width: {{#ifexpr: ({{{1|0}}}/{{{total|100}}})>1 | 0 | {{#expr: 100 - {{{1|<noinclude>2</noinclude>0}}} / {{{total|100}}} * 100}}}}%;
height: {{{height|2}}}px;
height: {{{height|2}}}px;
background:{{{color2|#eaecf0}}};
background:{{{color2|#eaecf0}}};

Latest revision as of 17:01, 7 December 2023

20% completed (estimate)