Sum of results is not 100%
You need to be logged in to post messages in the forums. New users may register here.
|
Jean-Luc Nguyen
Member since: 09 January 2008
Posts: 12
|
Friday 16 September 2011 6:16:07 pm
Hi,
I don't know if somebody has this strange behaviour, but on a only multiple choices survey, the sum of all pourcentages is either 99% or 101%. I guess the pourcentage of each result is incorrectly rounded.
I guess it is managed in: extension/ezsurvey/modules/survey/classes/ezsurveymultiplechoice.php
|
|
|
Jean-Luc Nguyen
Member since: 09 January 2008
Posts: 12
|
Friday 16 September 2011 6:26:17 pm
OK, solved it, on mentionned file:
extension/ezsurvey/modules/survey/classes/ezsurveymultiplechoice.php
Changed:
-
$percentage = (int) round( ( 100 * $row['count'] ) / $count );
to
+
$percentage = round( ( 100 * $row['count'] ) / $count, 2 );
In order to have pourcentage 100,01, which is better...
|
|
|
Nicolas Pastorino
Member since: 09 January 2008
Posts: 53
|
Monday 19 September 2011 10:57:53 am
|
|
You need to be logged in to post messages in the forums. New users may register here.