Login   Register  
PHP Classes
elePHPant
Icontem

Calculadora Escons: Calculate elected seats using D'Hondt method

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2007-07-01 (7 years ago) RSS 2.0 feedNot enough user ratingsTotal: 276 All time: 6,690 This week: 1,638Up
Version License PHP version Categories  
calculadoraescons 1.1GNU General Public Lice...5.0Algorithms
Description Author  

This class can be used to calculate the number of seats assigned to a party upon election results using the D'Hondt method.

It takes as parameters the number of available seats and an associative array that relates each party with the votes they received.

The class distributes the available seats using the D'Hondt method and returns an associative arrays that relates each party with the number of assigned seats that they got.

The code and the comments are in Catalan.

Innovation Award  
PHP Programming Innovation award nominee
June 2007
Number 10
The D'Hondt method is used in many countries to calculate the number of seats assigned to a party, depending on the percentage of votes that they get in elections.

This class provides an implementation of the D'Hondt method. It can be used by PHP sites that want to show on the Web the partial or final results of elections that take place on countries that use this method of assigning elected seats.

Manuel Lemos
Picture of Manel Zaera
Name: Manel Zaera <contact>
Classes: 3 packages by
Country: Spain Spain
Age: 40
All time rank: 201047 in Spain Spain
Week rank: 1826 Up49 in Spain Spain Down
Innovation award
Innovation award
Nominee: 1x

  Files folder image Files  
File Role Description
Plain text file CalculadoraEscons.php Class Class CalculdoraEscons
Accessible without login Plain text file exemple.php Example Sample file
Accessible without login Plain text file README Doc. README

 Version Control Unique User Downloads Download Rankings  
 0%Total:276All time:6,690
 This week:0This week:1,638Up