From ccc3266d2cc3f0d7ae0da1642cfce6fd94881f8f Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Sat, 4 Sep 2021 22:24:01 +1000 Subject: [PATCH] Add signs to Votes display, change default to Votes (transposed) --- html/index.html | 4 ++-- src/stv/wasm.rs | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/html/index.html b/html/index.html index c7ea41a..58d79a0 100644 --- a/html/index.html +++ b/html/index.html @@ -189,8 +189,8 @@ diff --git a/src/stv/wasm.rs b/src/stv/wasm.rs index 8afc2e7..3cc0fea 100644 --- a/src/stv/wasm.rs +++ b/src/stv/wasm.rs @@ -423,15 +423,15 @@ fn update_results_table(stage_num: usize, state: &CountState, opts "votes" => { match count_card.state { CandidateState::Hopeful | CandidateState::Guarded => { - result.push(&format!(r#"{}"#, classes_i, pp(&count_card.transfers, opts.pp_decimals)).into()); + result.push(&format!(r#"{}"#, classes_i, pps(&count_card.transfers, opts.pp_decimals)).into()); result.push(&format!(r#"{}"#, classes_i, pp(&count_card.votes, opts.pp_decimals)).into()); } CandidateState::Elected => { - result.push(&format!(r#"{}"#, classes_i, pp(&count_card.transfers, opts.pp_decimals)).into()); + result.push(&format!(r#"{}"#, classes_i, pps(&count_card.transfers, opts.pp_decimals)).into()); result.push(&format!(r#"{}"#, classes_i, pp(&count_card.votes, opts.pp_decimals)).into()); } CandidateState::Doomed => { - result.push(&format!(r#"{}"#, classes_i, pp(&count_card.transfers, opts.pp_decimals)).into()); + result.push(&format!(r#"{}"#, classes_i, pps(&count_card.transfers, opts.pp_decimals)).into()); result.push(&format!(r#"{}"#, classes_i, pp(&count_card.votes, opts.pp_decimals)).into()); } CandidateState::Withdrawn => { @@ -439,7 +439,7 @@ fn update_results_table(stage_num: usize, state: &CountState, opts result.push(&format!(r#"WD"#, classes_i).into()); } CandidateState::Excluded => { - result.push(&format!(r#"{}"#, classes_i, pp(&count_card.transfers, opts.pp_decimals)).into()); + result.push(&format!(r#"{}"#, classes_i, pps(&count_card.transfers, opts.pp_decimals)).into()); if count_card.votes.is_zero() && count_card.parcels.iter().all(|p| p.votes.is_empty()) { result.push(&format!(r#"Ex"#, classes_i).into()); } else { @@ -498,15 +498,15 @@ fn update_results_table(stage_num: usize, state: &CountState, opts "ballots_votes" => { match count_card.state { CandidateState::Hopeful | CandidateState::Guarded => { - result.push(&format!(r#"{}{}"#, classes_i, pp(&count_card.ballot_transfers, 0), pp(&count_card.transfers, opts.pp_decimals)).into()); + result.push(&format!(r#"{}{}"#, classes_i, pps(&count_card.ballot_transfers, 0), pps(&count_card.transfers, opts.pp_decimals)).into()); result.push(&format!(r#"{}{}"#, classes_i, pp(&count_card.num_ballots(), 0), pp(&count_card.votes, opts.pp_decimals)).into()); } CandidateState::Elected => { - result.push(&format!(r#"{}{}"#, classes_i, pp(&count_card.ballot_transfers, 0), pp(&count_card.transfers, opts.pp_decimals)).into()); + result.push(&format!(r#"{}{}"#, classes_i, pps(&count_card.ballot_transfers, 0), pps(&count_card.transfers, opts.pp_decimals)).into()); result.push(&format!(r#"{}{}"#, classes_i, pp(&count_card.num_ballots(), 0), pp(&count_card.votes, opts.pp_decimals)).into()); } CandidateState::Doomed => { - result.push(&format!(r#"{}{}"#, classes_i, pp(&count_card.ballot_transfers, 0), pp(&count_card.transfers, opts.pp_decimals)).into()); + result.push(&format!(r#"{}{}"#, classes_i, pps(&count_card.ballot_transfers, 0), pps(&count_card.transfers, opts.pp_decimals)).into()); result.push(&format!(r#"{}{}"#, classes_i, pp(&count_card.num_ballots(), 0), pp(&count_card.votes, opts.pp_decimals)).into()); } CandidateState::Withdrawn => { @@ -514,7 +514,7 @@ fn update_results_table(stage_num: usize, state: &CountState, opts result.push(&format!(r#"WD"#, classes_i).into()); } CandidateState::Excluded => { - result.push(&format!(r#"{}{}"#, classes_i, pp(&count_card.ballot_transfers, 0), pp(&count_card.transfers, opts.pp_decimals)).into()); + result.push(&format!(r#"{}{}"#, classes_i, pps(&count_card.ballot_transfers, 0), pps(&count_card.transfers, opts.pp_decimals)).into()); if count_card.votes.is_zero() && count_card.parcels.iter().all(|p| p.votes.is_empty()) { result.push(&format!(r#"Ex"#, classes_i).into()); } else {