Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-7644

Poll displays incorrect percentages due missing round() function

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 3.0.3
    • 3.0.2
    • Viewing posts
    • None
    • PHP Environment:
      Database:

      if you have a poll with 2 options (say yes and no) and 2 voters vote no and 1 yes, it will show 33% yes and 66% no, which should be 33% yes and 67% no

      Unless I'm looking at this wrong,
      $option_pct_txt = sprintf("%.1d%%", ($option_pct * 100));

      should be:
      $option_pct_txt = sprintf("%.1d%%", round($option_pct * 100));

            ToonArmy Chris Smith
            Blitze Blitze [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: