decidim-vocdoni / decidim-module-vocdoni

(WIP) A module for Decidim that brings an elections component based on the Vocdoni SDK and API
GNU Affero General Public License v3.0
7 stars 0 forks source link

Add Results in an Election public page #28

Closed andreslucena closed 1 year ago

andreslucena commented 1 year ago

This PR adds the results in the Election public page.

Fix #10

It also improve the seeds so its easier to check things like this out.

Screenshot

Selection_514

Testing

  1. Make an election
  2. Vote
  3. Publish the results
  4. View the results
andreslucena commented 1 year ago

@carolromero mind that both of the results on the screenshot provided are actually 101 when summed:

irb(main):001:0> 12 + 36 + 23 +  30
=> 101
irb(main):002:0> 14 + 18 + 69
=> 101

This is something that comes from the decidim-elections initial implementation:

image

It's a rounding error, so the easiest solution that I can find is to show at least two decimals:

image

On this case it sums up well:

irb(main):001:0> 11.57 + 35.65 + 23.15 + 29.63 
=> 100.0
irb(main):002:0> 13.89 + 17.59 + 68.52
=> 100.0