formbricks/formbricks

[BUG] Summary view proportions don't add up to 100%

Closed this issue · 2 comments

Issue Summary

In the summary view for Multiple-Choice Single-Select Question, the proportions do not always add up to 100%, but to 101% for example, most likely due to an rounding error.

Steps to Reproduce

  1. Have Multiple-Choice Single-Select Question
  2. Get numerous responses with various choice proportions
  3. Go to Summary tab
  4. Get wrong total proportions due to rounding error

Expected behavior

No rounding error

Other information

No response

Screenshots

Bildschirmfoto 2024-03-13 um 21 08 09

Environment

  • Formbricks Cloud (app.formbricks.com)
  • Self-hosted Formbricks

Desktop (please complete the following information)

- OS:
- Node:
- npm:

How would you fix that? By using more decimal places (and thus reducing the rounding error, but it may still not add up to 100%). Or by deliberately rounding incorrectly to force 100% (but then displaying mathematically incorrect numbers)?

@MaxWohlers @jonas-hoebenreich We will add another decimal to make the numbers more accurate :-)