The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Vote::Count::Helper::Table

VERSION 1.10

Description

Table Formatting Helpers for use within Vote::Count

SYNOPSIS

  use Vote::Count::Helper::Table 'ChargeTable';
  # $chargesPerChoice and $chargedPerChoice are from Vote::Count::Charge::Cascade
  say ChargeTable( $chargesPerChoice, $chargedPerChoice );

  use Vote::Count::Helper::Table 'WeightedTable';
  # When weighted voting is used will generate a table
  # with the Top Count and Approval totals
  say WeightedTable( $STV_Election );

ChargeTable

Arguments: $chargesPerChoice, $chargedPerChoice

chargesPerChoice is a HashRef with the choices as keys, and the values the charge assessed each ballot supporting the choice.

chargedPerChoice is a HashRef with the choices as keys and the values a HashRef with the keys value, count, surplus, where value is the total vote value charged for the choice, count is the number of ballots that contributed, and surplus the value above quota charged.

WeightedTable

Formats the current Vote Totals by Approval and Top Count when weighted voting is in use, for STV/Vote Charge methods.