Skip to content

Commit

Permalink
Merge pull request #12 from YujithIsura/master
Browse files Browse the repository at this point in the history
hide polled %ge and registered votes column until bug fixed
  • Loading branch information
YujithIsura authored Nov 18, 2019
2 parents 00dd6df + db3444a commit 4674152
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
4 changes: 3 additions & 1 deletion src/elections/DataUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,12 @@ export function getAggregateStats(results, mapFieldPrefix) {
* @example 0.54321 -> 54.3%
*/
export function formatPercent(x) {
if(x != null){
return x.toLocaleString('en-us', {
style: 'percent',
minimumFractionDigits: 2,
});
});}

}

/**
Expand Down
24 changes: 13 additions & 11 deletions src/elections/ResultsTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ export default class ResultsTable extends Component {
key={keyPrefix + 'header-total-polled'}
text="Total Polled"
/>,
<CellHeader
key={keyPrefix + 'header-registed-votes'}
text="Registered Votes"
/>,
// <CellHeader
// key={keyPrefix + 'header-registed-votes'}
// text="Registered Votes"
// />,
])
}</tr>
);
Expand Down Expand Up @@ -144,7 +144,7 @@ export default class ResultsTable extends Component {
);
});
const otherPartyVotes = totalValid - displayPartyVotes;

if (label === 'Final Results') {
className += ' tr-totals';
}
Expand Down Expand Up @@ -186,12 +186,14 @@ export default class ResultsTable extends Component {
<CellNumberPercent
key={key + '-total-polled-votes'}
value={totalPolled}
valuePercent={totalPolled / totalElectors}
/>,
<CellNumber
key={key + '-total-registered-voters'}
value={totalElectors}
valuePercent={null}
// valuePercent={totalPolled / totalElectors}

/>,
// <CellNumber
// key={key + '-total-registered-voters'}
// value={totalElectors}
// />,
])}
</tr>
);
Expand Down Expand Up @@ -231,7 +233,7 @@ export default class ResultsTable extends Component {
votesByParty,
totalValid,
);

const _tableRowList = results.map(
function(result, i) {
const key = 'table-row-' + i;
Expand Down

0 comments on commit 4674152

Please sign in to comment.