# Can someone explain me the math behind polls?

**URL:** https://meta.discourse.org/t/can-someone-explain-me-the-math-behind-polls/35900
**Category:** Support
**Created:** [Novembre 22, 2015, 9:13 UTC](https://meta.discourse.org/t/can-someone-explain-me-the-math-behind-polls/35900 "2015-11-22T09:13:20Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![terraboss](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/terraboss/32/381157_2.png) [@terraboss](https://meta.discourse.org/u/terraboss)
#### Post date: [Novembre 22, 2015, 9:13 UTC](https://meta.discourse.org/t/can-someone-explain-me-the-math-behind-polls/35900/1 "2015-11-22T09:13:20Z")

</div>

It’s a little bit confusing for me and others to understand the mathematical summary behind the percentages.

I’m the opinion that all answers per poll should result to 100% and not 200%. Even for two votes. That’s not logical.

Is this a bug?

 ![](https://global.discourse-cdn.com/meta/original/3X/6/e/6e281feab45ca4547e27714f78652c4db919d6ca.png)

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [Novembre 22, 2015, 9:19 UTC](https://meta.discourse.org/t/can-someone-explain-me-the-math-behind-polls/35900/2 "2015-11-22T09:19:25Z")

</div>

Wasn’t this just fixed?

> [@Polls percentage accounting is not accurate](https://meta.discourse.org/t/polls-percentage-accounting-is-not-accurate/35772):
>
> It seems when calculating percentage for each option in polls Discourse uses floats truncating instead of rounding. This can result into inaccurate percentage values. For instance, a poll with 2 options, 11 voters and votes spread as 5 for the 1st option and 6 for the 2nd option indicates 45% and 54% which is 99% in total but should be 100%. The math looks to be the following: 100/11\*5 is 45.45, which rounded to 0 decimal places is 45, and also truncated to 0 decimal places is 45. 100/11\*6 is…

---

<div class="post-metadata">

### Author: ![terraboss](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/terraboss/32/381157_2.png) [@terraboss](https://meta.discourse.org/u/terraboss)
#### Post date: [Novembre 22, 2015, 9:20 UTC](https://meta.discourse.org/t/can-someone-explain-me-the-math-behind-polls/35900/3 "2015-11-22T09:20:27Z")

</div>

I’m running the latest-release +59. ☹

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [Novembre 22, 2015, 10:59 UTC](https://meta.discourse.org/t/can-someone-explain-me-the-math-behind-polls/35900/4 "2015-11-22T10:59:36Z")

</div>

The meaning of that poll result is:

- 49% of all voters selected “Montags”
- 24% of all voters selected “Dienstags”
- …

This seems to be a multiple choice poll, so it is perfectly normal that the sum of the percentages is greater than 100%. But the -1% definitely looks like a bug.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [Novembre 22, 2015, 1:23 UTC](https://meta.discourse.org/t/can-someone-explain-me-the-math-behind-polls/35900/5 "2015-11-22T13:23:55Z")

</div>

Yeah I will deactivate the “rounding up to 100%” on multiple polls. Nice catch 👍

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [Novembre 23, 2015, 10:35 UTC](https://meta.discourse.org/t/can-someone-explain-me-the-math-behind-polls/35900/6 "2015-11-23T10:35:01Z")

</div>

@terraboss, I just pushed a fix for multiple choice polls 🍤

[https://github.com/discourse/discourse/commit/9d2128dad30aaa96a0b13be666daabbbba2993f8](https://github.com/discourse/discourse/commit/9d2128dad30aaa96a0b13be666daabbbba2993f8)

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [Novembre 23, 2015, 12:35 UTC](https://meta.discourse.org/t/can-someone-explain-me-the-math-behind-polls/35900/7 "2015-11-23T12:35:09Z")

</div>

This topic was automatically closed after 2 hours. New replies are no longer allowed.
