Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-13027

PM folder full percentage could be a bit more accurate

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 3.0.12, 3.1.0-RC3
    • Fix Version/s: 3.1.0-RC5
    • Labels:
      None
    • Environment:
      phpbb.com

      Description

      "Folder is 100% full (996 from 1000 messages stored)" does not seem too accurate, obviously. The line of code that determines this percentage is in functions_privmsgs.php:

      		'percent'		=> ($user->data['message_limit']) ? (($user->data['message_limit'] > 0) ? round(($folder['num_messages'] / $user->data['message_limit']) * 100) : 100) : 0,

      The use of the round function might not be appropriate here. Perhaps using number_format instead with the second parameter (decimals) being a 1 or a 2?

        Activity

        Hide
        Senky Senky added a comment -

        What about using floor() function instead of round()?

        Show
        Senky Senky added a comment - What about using floor() function instead of round()?
        Hide
        nickvergessen Joas Schilling added a comment -

        Senky seems about right, feel free to make a PR

        Show
        nickvergessen Joas Schilling added a comment - Senky seems about right, feel free to make a PR
        Hide
        bantu Andreas Fischer added a comment -

        Won't fix for 3.0.x

        Show
        bantu Andreas Fischer added a comment - Won't fix for 3.0.x

          People

          • Assignee:
            nickvergessen Joas Schilling
            Reporter:
            DavidIQ David Colón
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development