Skip to content

Commit

Permalink
Merge pull request #120 from sanjiva/master
Browse files Browse the repository at this point in the history
Dont skip postal divs any more in accumulation as they're now separated
  • Loading branch information
sanjiva committed Nov 16, 2019
2 parents 943542d + 022dd1d commit b498661
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions distributor/src/distributor/save.bal
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,7 @@ function addToCumulative (map<json> jm) {
accum.summary.polled += <int>jm.summary.polled;
// don't add up electors from postal PDs as those are already in the district elsewhere
string pdCode = <string>jm.pd_code;
if !pdCode.endsWith("P") {
accum.summary.electors += <int>jm.summary.electors;
}
accum.summary.electors += <int>jm.summary.electors;
accum.summary.percent_valid = (accum.summary.polled == 0) ? "0.00" : io:sprintf("%.2f", accum.summary.valid*100.0/accum.summary.polled);
accum.summary.percent_rejected = (accum.summary.polled == 0) ? "0.00" : io:sprintf("%.2f", accum.summary.rejected*100.0/accum.summary.polled);
accum.summary.percent_polled = (accum.summary.electors == 0) ? "0.00" : io:sprintf("%.2f", accum.summary.polled*100.0/accum.summary.electors);
Expand Down

0 comments on commit b498661

Please sign in to comment.