User:Kermanbob/sandbox/templatetest2/doc
Appearance
This is a documentation subpage for User:Kermanbob/sandbox/templatetest2. It may contain usage information, categories and other content that is not part of the original user template page. |
Usage
[edit]Creates a Gallagher index table that automatically calculates the Gallagher index based on provided vote and seat percentages.
{{user:Kermanbob/sandbox/templatetest2 |color1 = First party color (templates allowed) |party1 = First party name (wikilink preffered) |votes1 = First party vote percentage (no % symbol) |seats1 = First party seat percentage (no % symbol) |color2 = Second party color |party2 = Second party name |votes2 = Second party vote percentage (no % symbol) |seats2 = Seconf party seat percentage (no % symbol) <!-- Continues till color10, party10, votes10 and seats10--> }}
Parameters
[edit]Parameter | Description |
---|---|
|party1=
|
The party's name, wikilinks preffered |
|color1=
|
The party's color, templates can be used. |
|votes1=
|
The party's percentage vote share. (No % symbol or comma decimal seperator) |
|seats1=
|
The party's percentage seat share. (No % symbol or comma decimal seperator) |
Parties can be numbered from 1-10 |
Example
[edit]Example result for the 2015 Canadian Federal Election
Party | Votes (%) | Seats (%) | Difference | Difference squared | |
---|---|---|---|---|---|
Liberal | 39.47% | 54.44% | -14.97 | 224.1009 | |
Conservatives | 31.89% | 29.29% | 2.6 | 6.76 | |
New Democratic | 19.71% | 13.02% | 6.69 | 44.7561 | |
Bloc Québecois | 4.66% | 2.96% | 1.7 | 2.89 | |
Green | 3.45% | 0.29% | 3.16 | 9.9856 | |
Other | 0.82% | 0% | 0.82 | 0.6724 | |
Total of squares of differences | 289.165 | ||||
Total / 2 | 144.5825 | ||||
Square root of (Total / 2) | 12.02 |
{{user:Kermanbob/sandbox/templatetest2 |color1 = {{Canadian party colour|CA|Liberal}} |party1 = Liberal |votes1 = 39.47 |seats1 = 54.44 |color2 = {{Canadian party colour|CA|Conservative}} |party2 = Conservatives |votes2 = 31.89 |seats2 = 29.29 |color3 = {{Canadian party colour|CA|NDP}} |party3 = New Democratic |votes3 = 19.71 |seats3 = 13.02 |color4 = {{Canadian party colour|CA|BQ}} |party4 = Bloc Québecois |votes4 = 4.66 |seats4 = 2.96 |color5 = {{Canadian party colour|CA|Green}} |party5 = Green |votes5 = 3.45 |seats5 = 0.29 |color6 = {{Canadian party colour|CA|Others}} |party6 = Other |votes6 = 0.82 |seats6 = 0 |party7 = Error example |votes7 = Values such as 2%; 2,14; text; null/blank |seats7 = Row will not be shown for any of these values }}