Template:Referendum: Difference between revisions
From MicrasWiki
Jump to navigationJump to search
(Created page with "{|width="390" cellspacing="0" cellpadding="4" border="1" align="right" style="margin: 0 0 1em 1em; border: 1px #aaaaaa solid; border-collapse: collapse; font-size: 95%;" |+<bi...") |
No edit summary |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 10: | Line 10: | ||
|- | |- | ||
|bgcolor=f9f9f9 align=left |{{{Answer1}}} | |bgcolor=f9f9f9 align=left |{{{Answer1}}} | ||
|bgcolor=f9f9f9 align=right|{{{Answer1number}}} | |bgcolor=f9f9f9 align=right|{{formatnum:{{{Answer1number}}}}} | ||
|bgcolor=f9f9f9 align=right|{{{ | |bgcolor=f9f9f9 align=right|{{#iferror:{{#expr:({{{Answer1number|0}}})/({{{Answer1number|0}}}+{{{Answer2number|0}}}+{{#if:{{{Answer3|}}}|{{{Answer3number}}}|0}}+{{#if:{{{Answer4|}}}|{{{Answer4number}}}|0}})*100 round 2}}|0}}% | ||
|- style="border-width: 20px" | |- style="border-width: 20px" | ||
|bgcolor=f9f9f9 align=left |{{{Answer2}}} | |bgcolor=f9f9f9 align=left |{{{Answer2}}} | ||
|bgcolor=f9f9f9 align=right|{{{Answer2number}}} | |bgcolor=f9f9f9 align=right|{{formatnum:{{{Answer2number}}}}} | ||
|bgcolor=f9f9f9 align=right|{{{ | |bgcolor=f9f9f9 align=right|{{#iferror:{{#expr:({{{Answer2number|0}}})/({{{Answer1number|0}}}+{{{Answer2number|0}}}+{{#if:{{{Answer3|}}}|{{{Answer3number}}}|0}}+{{#if:{{{Answer4|}}}|{{{Answer4number}}}|0}})*100 round 2}}|0}}%{{#if:{{{Answer3|}}}|<br> | ||
{{!}}- | {{!}}- | ||
{{!}}bgcolor=f9f9f9 align=left {{!}} {{ | {{!}}bgcolor=f9f9f9 align=left {{!}} {{{Answer3}}} | ||
{{!}}bgcolor=f9f9f9 align=right{{!}} {{# | {{!}}bgcolor=f9f9f9 align=right{{!}} {{formatnum:{{{Answer3number}}}}} | ||
{{ | {{!}}bgcolor=f9f9f9 align=right{{!}} {{#iferror:{{#expr:({{{Answer3number|0}}})/({{{Answer1number|0}}}+{{{Answer2number|0}}}+{{#if:{{{Answer3|}}}|{{{Answer3number}}}|0}}+{{#if:{{{Answer4|}}}|{{{Answer4number}}}|0}})*100 round 2}}|0}}%|}}{{#if:{{{Answer4|}}}|<br> | ||
{{!}}- | {{!}}- | ||
{{!}}bgcolor=f9f9f9 align=left {{!}} {{ | {{!}}bgcolor=f9f9f9 align=left {{!}} {{{Answer4}}} | ||
{{!}}bgcolor=f9f9f9 align=right{{!}} {{# | {{!}}bgcolor=f9f9f9 align=right{{!}} {{formatnum:{{{Answer4number}}}}} | ||
{{ | {{!}}bgcolor=f9f9f9 align=right{{!}} {{#iferror:{{#expr:({{{Answer4number|0}}})/({{{Answer1number|0}}}+{{{Answer2number|0}}}+{{#if:{{{Answer3|}}}|{{{Answer3number}}}|0}}+{{#if:{{{Answer4|}}}|{{{Answer4number}}}|0}})*100 round 2}}|0}}%|}} | ||
|- | |- | ||
|bgcolor=eeeeee align=left |Valid votes | |bgcolor=eeeeee align=left |Valid votes | ||
|bgcolor=eeeeee align=right|{{{ | |bgcolor=eeeeee align=right|{{formatnum:{{#expr:{{{Answer1number|0}}}+{{{Answer2number|0}}}+{{#if:{{{Answer3|}}}|{{{Answer3number}}}|0}}+{{#if:{{{Answer|}}}|{{{Answer4number}}}|0}}}}}} | ||
|bgcolor=eeeeee align=right|{{{ | |bgcolor=eeeeee align=right|{{#iferror:{{#expr:({{{Answer1number|0}}}+{{{Answer2number|0}}}+{{#if:{{{Answer3|}}}|{{{Answer3number}}}|0}}+{{#if:{{{Answer4|}}}|{{{Answer4number}}}|0}})/({{{Answer1number|0}}}+{{{Answer2number|0}}}+{{#if:{{{Answer3|}}}|{{{Answer3number}}}|0}}+{{#if:{{{Answer4|}}}|{{{Answer4number}}}|0}}+{{{Invalid1number|1}}})*100 round 2}}|0}}% | ||
|- | |- | ||
|bgcolor=eeeeee align=left |Invalid votes | |bgcolor=eeeeee align=left |Invalid votes | ||
|bgcolor=eeeeee align=right|{{{Invalid1number}}} | |bgcolor=eeeeee align=right|{{formatnum:{{{Invalid1number|0}}}}} | ||
|bgcolor=eeeeee align=right|{{{ | |bgcolor=eeeeee align=right|{{#iferror:{{#expr:{{{Invalid1number|0}}}/({{{Answer1number|0}}}+{{{Answer2number|0}}}+{{#if:{{{Answer3|}}}|{{{Answer3number}}}|0}}+{{#if:{{{Answer4|}}}|{{{Answer4number}}}|0}}+{{{Invalid1number|1}}})*100 round 2}}|0}}% | ||
|- | |- | ||
!bgcolor=eeeeee align=left |Total votes | !bgcolor=eeeeee align=left |Total votes | ||
|bgcolor=eeeeee align=right|{{{ | |bgcolor=eeeeee align=right|{{formatnum:{{#expr:({{{Answer1number|0}}}+{{{Answer2number|0}}}+{{#if:{{{Answer3|}}}|{{{Answer3number}}}|0}}+{{#if:{{{Answer4|}}}|{{{Answer4number}}}|0}}+{{{Invalid1number|0}}})}}}} | ||
|bgcolor=eeeeee align=right|{{{ | |bgcolor=eeeeee align=right|100%<!-- | ||
START SECOND QUESTION | |||
-->{{#if:{{{Question2|}}}|<br> | |||
{{!}}- | |||
!align="center" colspan="5" bgcolor=f9f9f9 {{!}} | |||
{{!}}- | |||
{{!}}align="center" colspan="5" bgcolor=f9f9f9 {{!}}''{{{Question2}}}'' | |||
{{!}}- | |||
{{!}}align="center" colspan="5" bgcolor=eeeeee {{!}}'''Results''' | |||
{{!}}- | |||
!bgcolor=eeeeee width=40%{{!}} | |||
!bgcolor=e9e9e9 {{!}}Votes | |||
!bgcolor=e9e9e9 {{!}}% | |||
{{!}}- | |||
{{!}}bgcolor=f9f9f9 align=left {{!}} {{{Answer5}}} | |||
{{!}}bgcolor=f9f9f9 align=right{{!}} {{formatnum:{{{Answer5number}}}}} | |||
{{!}}bgcolor=f9f9f9 align=right{{!}} {{#iferror:{{#expr:({{{Answer5number|0}}})/({{{Answer5number|0}}}+{{{Answer6number|0}}}+{{#if:{{{Answer7|}}}|{{{Answer7number}}}|0}}+{{#if:{{{Answer8|}}}|{{{Answer8number}}}|0}})*100 round 2}}|0}}% | |||
{{!}}- style="border-width: 20px" | |||
{{!}}bgcolor=f9f9f9 align=left {{!}} {{{Answer6}}} | |||
{{!}}bgcolor=f9f9f9 align=right{{!}} {{formatnum:{{{Answer6number}}}}} | |||
{{!}}bgcolor=f9f9f9 align=right{{!}} {{#iferror:{{#expr:({{{Answer6number|0}}})/({{{Answer5number|0}}}+{{{Answer6number|0}}}+{{#if:{{{Answer7|}}}|{{{Answer7number}}}|0}}+{{#if:{{{Answer8|}}}|{{{Answer8number}}}|0}})*100 round 2}}|0}}%{{#if:{{{Answer7|}}}|<br> | |||
{{!}}- | |||
{{!}}bgcolor=f9f9f9 align=left {{!}} {{{Answer7}}} | |||
{{!}}bgcolor=f9f9f9 align=right{{!}} {{formatnum:{{{Answer7number}}}}} | |||
{{!}}bgcolor=f9f9f9 align=right{{!}} {{#iferror:{{#expr:({{{Answer7number|0}}})/({{{Answer5number|0}}}+{{{Answer6number|0}}}+{{#if:{{{Answer7|}}}|{{{Answer7number}}}|0}}+{{#if:{{{Answer8|}}}|{{{Answer8number}}}|0}})*100 round 2}}|0}}%|}}{{#if:{{{Answer8|}}}|<br> | |||
{{!}}- | |||
{{!}}bgcolor=f9f9f9 align=left {{!}} {{{Answer8}}} | |||
{{!}}bgcolor=f9f9f9 align=right{{!}} {{formatnum:{{{Answer8number}}}}} | |||
{{!}}bgcolor=f9f9f9 align=right{{!}} {{#iferror:{{#expr:({{{Answer8number|0}}})/({{{Answer5number|0}}}+{{{Answer6number|0}}}+{{#if:{{{Answer7|}}}|{{{Answer7number}}}|0}}+{{#if:{{{Answer8|}}}|{{{Answer8number}}}|0}})*100 round 2}}|0}}% |}} | |||
{{!}}- | |||
{{!}}bgcolor=eeeeee align=left {{!}} Valid votes | |||
{{!}}bgcolor=eeeeee align=right{{!}} {{formatnum:{{#expr:{{{Answer5number|0}}}+{{{Answer6number|0}}}+{{#if:{{{Answer7|}}}|{{{Answer7number}}}|0}}+{{#if:{{{Answer8|}}}|{{{Answer8number}}}|0}}}}}} | |||
{{!}}bgcolor=eeeeee align=right{{!}} {{#iferror:{{#expr:({{{Answer5number|0}}}+{{{Answer6number|0}}}+{{#if:{{{Answer7|}}}|{{{Answer7number}}}|0}}+{{#if:{{{Answer8|}}}|{{{Answer8number}}}|0}})/({{{Answer5number|0}}}+{{{Answer6number|0}}}+{{#if:{{{Answer7|}}}|{{{Answer7number}}}|0}}+{{#if:{{{Answer8|}}}|{{{Answer8number}}}|0}}+{{{Invalid2number|1}}})*100 round 2}}|0}}% | |||
{{!}}- | |||
{{!}}bgcolor=eeeeee align=left {{!}} Invalid votes | |||
{{!}}bgcolor=eeeeee align=right{{!}} {{formatnum:{{{Invalid2number|0}}}}} | |||
{{!}}bgcolor=eeeeee align=right{{!}} {{#iferror:{{#expr:{{{Invalid2number|0}}}/({{{Answer5number|0}}}+{{{Answer6number|0}}}+{{#if:{{{Answer7|}}}|{{{Answer7number}}}|0}}+{{#if:{{{Answer8|}}}|{{{Answer8number}}}|0}}+{{{Invalid2number|1}}})*100 round 2}}|0}}% | |||
{{!}}- | |||
{{!}}bgcolor=eeeeee align=left {{!}} Total votes | |||
{{!}}bgcolor=eeeeee align=right{{!}} {{formatnum:{{#expr:({{{Answer5number|0}}}+{{{Answer6number|0}}}+{{#if:{{{Answer7|}}}|{{{Answer7number}}}|0}}+{{#if:{{{Answer8|}}}|{{{Answer8number}}}|0}}+{{{Invalid2number|0}}})}}}} | |||
{{!}}bgcolor=eeeeee align=right{{!}} 100% |}} | |||
|} | |} | ||
Line 42: | Line 85: | ||
[[Category:Infobox templates]] | [[Category:Infobox templates]] | ||
</noinclude> | </noinclude> | ||
[[Category:Referendums]] |
Latest revision as of 01:08, 24 November 2020
{{{Question1}}} | ||||
Results | ||||
Votes | % | |||
---|---|---|---|---|
{{{Answer1}}} | {{{Answer1number}}} | 0% | ||
{{{Answer2}}} | {{{Answer2number}}} | 0% | ||
Valid votes | 0 | 0% | ||
Invalid votes | 0 | 0% | ||
Total votes | 0 | 100% |
[edit] [ ] Template documentation
- You can use up to 4 options per referendum
- Answers 3 and 4 are not shown when left blank
{{Referendum |Question1 = Referendum question |Answer1 = Answer 1 |Answer1number = Number of votes for answer 1 |Answer2 = |Answer2number = |Answer3 = |Answer3number = |Answer4 = |Answer4number = |Invalid1number = Number of invalid votes (must be at least 0) |Question2 = Second referendum question |Answer5 = Answer 1 to second question |Answer5number = |Answer6 = |Answer6number = |Answer7 = |Answer7number = |Answer8 = |Answer8number = |Invalid2number = }}
The above documentation is transcluded from Template:Referendum/doc. (edit | history) Editors can experiment in this template's sandbox (create) and testcases (create) pages. Please add categories and interwikis to the /doc subpage. Subpages of this template. |