Jump to content

User:Kermanbob/sandbox/templatetest3/doc

From Wikipedia, the free encyclopedia

Usage[edit]

Creates a Gallagher index table that automatically calculates the Gallagher index based on provided vote and seat percentages.

{{user:Kermanbob/sandbox/templatetest3
|election = Election name (wikilink preffered)
|side = Side for the table to float on, inputs "left" or "right" (no quotation marks)
|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
|election= The name of the election, wikilinks preffered
|side= The side that the table will float on, inputs are "left" or "right" (no quotation marks)
|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


Gallagher Index 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 differences squared 289.165
Total / 2 144.5825
Square root of (Total / 2): Gallagher Index result 12.02


{{user:Kermanbob/sandbox/templatetest3
|election = [[2015 Canadian federal election]]
|side = right
|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
}}