Sainte-Laguë
A module to calculate proportionally how many seats a party will receive under the Sainte-Laguë formula. The defaults are the New Zealand system where 5% or one electorate seat is required for proportionality.
List size is optional, but if included an underhang will be applied as best it's able.
Usage
var lague = require('saintelague'),
parties,
results;
parties = [
{ name: 'A', votes: 100, electorates: 1 },
{ name: 'B', votes: 5, electorates: 10 },
{ name: 'C', votes: 5, electorates: 0 },
{ name: 'D', votes: 50, electorates: 1, listSize: 5 }
];
result = lague(parties, {
overhang: true,
seats: 120,
threshold: 0.05,
tagAlong: true,
tagAlongSeats: 1
});