Uploaded image for project: 'Commons IO'
  1. Commons IO
  2. IO-226

Rounding issue with byteCountToDisplaySize(long size)

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0
    • Component/s: Utilities
    • Labels:
      None

      Description

      I do not understand the byteCountToDisplaySize(long size) method which is in class FileUtils of the package org.apache.commons.io.
      If the parameter size is 2047 , the method will return 1 KB.Why it will lose precision.
      I read the code.
      Maybe it is a bug?

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              shukaiyuan shu kai yuan
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: