Percentages

This example uses both the PHP and JavaScript classes. While, the poll's options and votes are determined client-side, initially the percentages are calculated server-side. From the moment you cast a vote, all percentages (and sums) will be calculated through the JavaScript class.

For the sake of the demo, the amount of votes is shown and voting will not be disabled after you cast a vote.

Framework Percentage (%)
Name Votes Absolute Rounded Corrected
{{ option.name }} {{ option.votes }} {{ percentages.absolute[index] }}% {{ percentages.rounded[index] }}% {{ percentages.corrected[index] }}%
Total percentage (%) {{ percentages.roundedSum }}% {{ percentages.correctedSum }}%