1.0.8 • Published 5 years ago

thailand-party-list-calculator v1.0.8

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

Thailand Party List Calculator

According to Constitution of Kingdom of Thailand 2017, the election system adopts Mixed Members Appointment system (MMA) to make sure that the people's vote percentage reflects the percentage of each party in House of Representatives.

This code implementation is based on Organic Act on the Election of Members of the House of Representatives, B.E. 2561 (2018) ( พระราชบัญญัติประกอบรัฐธรรมนูญว่าด้วยการเลือกตั้งสมาชิกสภาผู้แทนราษฎร พ.ศ. 2561)

Disclaimer

This is not the official software. We do not hold any responsibility for any mistake in any law interpretation or logic implementation.

Installation

npm install thailand-party-list-calculator

or

yarn add thailand-party-list-calculator

Usage

const parties = calculatePartyList([
  {
    id: "1", // Unique ID
    electedMemberCount: 100, // Number of constituency candates of the party
    voteCount: 1000, // Total number of vote of the party
    partyListCandidateCount: 150 // Number of party list candidates of the party
  },
  {
    ...
  }
])

// parties[0].partyListMemberCount

Changelog

  • v1.0.5 Change the formula to aligned with the ECT's result announcement
1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago