result,
body += "";
body += "
Total Valid Votes
" +
"
" + commaFormatInt(result.summary.valid) +
- "
" + result.summary.percent_valid + "%
";
+ "
" + result.summary.percent_valid + "
";
body += " Rejected Votes
" +
" " + commaFormatInt(result.summary.rejected) +
- "
" + result.summary.percent_rejected + "%
";
+ " " + result.summary.percent_rejected + "
";
body += " Total Polled
" +
" " + commaFormatInt(result.summary.polled) +
- "
" + result.summary.percent_polled + "%
";
+ " " + result.summary.percent_polled + "
";
body += " Registered No. of Electors
" +
" " + commaFormatInt(result.summary.electors) +
"
";
diff --git a/distributor/src/distributor/save.bal b/distributor/src/distributor/save.bal
index 8dd105b..18f1bb8 100644
--- a/distributor/src/distributor/save.bal
+++ b/distributor/src/distributor/save.bal
@@ -300,8 +300,6 @@ function addToPresidentialCumulative(map jm) returns PresidentialCumulativ
accum.summary.valid += jm.summary.valid;
accum.summary.rejected += jm.summary.rejected;
accum.summary.polled += jm.summary.polled;
- // don't add up electors from postal PDs as those are already in the district elsewhere
- string pdCode = jm.pd_code; // check
accum.summary.electors += 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);
@@ -365,12 +363,10 @@ function addToParliamentaryCumulativeVotes(map jm) returns ParliamentaryCu
summary.valid += jm.summary.valid;
summary.rejected += jm.summary.rejected;
summary.polled += jm.summary.polled;
- // // don't add up electors from postal PDs as those are already in the district elsewhere
- // string pdCode = jm.pd_code; // check
summary.electors += jm.summary.electors;
- summary.percent_valid = (accum.summary.polled == 0) ? "0.00" : io:sprintf("%.2f", accum.summary.valid*100.0/accum.summary.polled);
- summary.percent_rejected = (accum.summary.polled == 0) ? "0.00" : io:sprintf("%.2f", accum.summary.rejected*100.0/accum.summary.polled);
- summary.percent_polled = (accum.summary.electors == 0) ? "0.00" : io:sprintf("%.2f", accum.summary.polled*100.0/accum.summary.electors);
+ summary.percent_valid = (accum.summary.polled == 0) ? "0.00%" : string `${io:sprintf("%.2f", accum.summary.valid*100.0/accum.summary.polled)}%`;
+ summary.percent_rejected = (accum.summary.polled == 0) ? "0.00%" : string `${io:sprintf("%.2f", accum.summary.rejected*100.0/accum.summary.polled)}%`;
+ summary.percent_polled = (accum.summary.electors == 0) ? "0.00%" : string `${io:sprintf("%.2f", accum.summary.polled*100.0/accum.summary.electors)}%`;
if accum.nadded == 0 {
pr.forEach(x => accum.by_party.push(checkpanic ParliamentaryPartyResult.constructFrom(x)));
@@ -384,7 +380,7 @@ function addToParliamentaryCumulativeVotes(map jm) returns ParliamentaryCu
} else {
int accumVoteCount = accum.by_party[i]?.vote_count + pr[i].vote_count;
accum.by_party[i].vote_count = accumVoteCount;
- accum.by_party[i].vote_percentage = (accum.summary.valid == 0) ? "0.00" : io:sprintf ("%.2f", ((accumVoteCount*1.0)/accum.summary.valid));
+ accum.by_party[i].vote_percentage = (accum.summary.valid == 0) ? "0.00%" : string `${io:sprintf ("%.2f", ((accumVoteCount*100.0)/accum.summary.valid))}%`;
}
}
}
diff --git a/distributor/web/active-2020-07-26 b/distributor/web/active-2020-07-28-I
similarity index 100%
rename from distributor/web/active-2020-07-26
rename to distributor/web/active-2020-07-28-I
diff --git a/distributor/web/info.txt b/distributor/web/info.txt
index be5e764..b36d46c 100644
--- a/distributor/web/info.txt
+++ b/distributor/web/info.txt
@@ -2,15 +2,15 @@
****** IMPORTANT *******
**
-** The latest version of the subscriber JAR is subscriber-20200726.jar
+** The latest version of the subscriber JAR is subscriber-20200728-I.jar
**
-** Available at https://github.com/ECLK/Results-Dist/releases/tag/v2020-07-26
+** Available at https://github.com/ECLK/Results-Dist/releases/tag/v2020-07-28-I
**
****** IMPORTANT *******
Run it as follows:
-java -jar subscriber-20200726.jar [options]
+java -jar subscriber-20200728-I.jar [options]
where options are:
-username=name my username for authentication
diff --git a/subscriber/src/subscriber/constants.bal b/subscriber/src/subscriber/constants.bal
index 1653061..859f514 100644
--- a/subscriber/src/subscriber/constants.bal
+++ b/subscriber/src/subscriber/constants.bal
@@ -9,7 +9,7 @@ const LEVEL_NF = "NATIONAL-FINAL";
const WANT_IMAGE = "image=true";
const WANT_AWAIT_RESULTS = "await=true";
-const MY_VERSION = "2020-07-26";
+const MY_VERSION = "2020-07-28-I";
const UNDERSOCRE = "_";
const COLON = ":";
diff --git a/subscriber/src/subscriber/genhtml.bal b/subscriber/src/subscriber/genhtml.bal
index 406e724..a5ccde0 100644
--- a/subscriber/src/subscriber/genhtml.bal
+++ b/subscriber/src/subscriber/genhtml.bal
@@ -175,13 +175,13 @@ function generateParliamentaryResultHtml(string electionCode, map result,
body += "";
body += "
Total Valid Votes
" +
"
" + commaFormatInt(result.summary.valid) +
- "
" + result.summary.percent_valid + "%
";
+ "
" + result.summary.percent_valid + "
";
body += " Rejected Votes
" +
" " + commaFormatInt(result.summary.rejected) +
- "
" + result.summary.percent_rejected + "%
";
+ " " + result.summary.percent_rejected + "
";
body += " Total Polled
" +
" " + commaFormatInt(result.summary.polled) +
- "
" + result.summary.percent_polled + "%
";
+ " " + result.summary.percent_polled + "
";
body += " Registered No. of Electors
" +
" " + commaFormatInt(result.summary.electors) +
"
";
diff --git a/subscriber/src/subscriber/subscriber.bal b/subscriber/src/subscriber/subscriber.bal
index 82a89f7..33debb4 100644
--- a/subscriber/src/subscriber/subscriber.bal
+++ b/subscriber/src/subscriber/subscriber.bal
@@ -131,13 +131,13 @@ public function main (string? username = (), // my username
http:WebSocketClient wsClientEp = new (wsUrl, config = {
callbackService: callbackService,
- customHeaders: headers,
- retryConfig: {
- intervalInMillis: 3000,
- maxCount: 10,
- backOffFactor: 1.5,
- maxWaitIntervalInMillis: 20000
- }
+ customHeaders: headers
+ // retryConfig: {
+ // intervalInMillis: 3000,
+ // maxCount: 10,
+ // backOffFactor: 1.5,
+ // maxWaitIntervalInMillis: 20000
+ // }
});
if wsClientEp.isOpen() {
diff --git a/subscriber/src/subscriber/tests/main_test.bal b/subscriber/src/subscriber/tests/main_test.bal
index 7bfff75..6ccab8f 100644
--- a/subscriber/src/subscriber/tests/main_test.bal
+++ b/subscriber/src/subscriber/tests/main_test.bal
@@ -49,17 +49,17 @@ function testRE_VI(string filePath, int fooCount, int barCount, int bazCount, in
map party =