Show total vote in report
This commit is contained in:
parent
8a92c17cb3
commit
f4fdf64072
@ -113,8 +113,6 @@ where
|
||||
|
||||
// Distribute first preferences
|
||||
stv::count_init(&mut state, &stv_opts);
|
||||
|
||||
// Display
|
||||
let mut stage_num = 1;
|
||||
make_and_print_result(stage_num, &state, &cmd_opts);
|
||||
|
||||
@ -187,6 +185,11 @@ fn print_stage<N: Number>(stage_num: usize, result: &StageResult<N>, cmd_opts: &
|
||||
println!("Exhausted: {:.dps$} ({:.dps$})", state.exhausted.votes, state.exhausted.transfers, dps=cmd_opts.pp_decimals);
|
||||
println!("Loss by fraction: {:.dps$} ({:.dps$})", state.loss_fraction.votes, state.loss_fraction.transfers, dps=cmd_opts.pp_decimals);
|
||||
|
||||
let mut total_vote = state.candidates.values().fold(N::zero(), |acc, cc| { acc + &cc.votes });
|
||||
total_vote += &state.exhausted.votes;
|
||||
total_vote += &state.loss_fraction.votes;
|
||||
println!("Total votes: {:.dps$}", total_vote, dps=cmd_opts.pp_decimals);
|
||||
|
||||
println!("Quota: {:.dps$}", state.quota, dps=cmd_opts.pp_decimals);
|
||||
|
||||
println!("");
|
||||
|
Loading…
Reference in New Issue
Block a user