Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-14014

Webin: poll.tpl - The rounding on information collection is too optimistic

    XMLWordPrintable

Details

    Description

      design/ezwebin/templates/content/collectedinfo/poll.tpl:57

      {set $percentage = cond( $total_count|gt( 0 ), round( div( mul( $item_count, 100 ),$total_count ) ), 0 )}
      

      With this

      {set $percentage = cond( $total_count|gt( 0 ), div( mul( $item_count, 100 ), $total_count ), 0 )}
      
      Steps to reproduce

      Create a Poll with a yes/no question
      1) Select that object
      2) Answer 5 times "yes" to the binary question
      3) Anwser 3 times "no" to the binary question
      4) View the stats, and check the percentage of "yes" and "no"

      Expected results:
      62,5% of "yes" and 37,5% "no" => 100%.

      Actual results
      63% of "yes" and 38% "no" => 101%.

      Attachments

        Activity

          People

            unknown unknown
            rla rla
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: