Skip to content

Bug: Files uses incorrect size unit mappings #16919

@dongle-the-gadget

Description

@dongle-the-gadget

Description

Related to #10075, opening as a separate issue as this is a bug and not a feature.

Previously found in #16882, Files uses incorrect size unit mappings, as it internally calculates sizes in base-two (so the appropriate units are kibibytes, mebibytes, etc.) but it shows to the user base-ten units (kilobytes, megabytes) instead.

This causes a disparity in the screenshot of #16882 where Files UI determined that 1007 GB is smaller than 1 TB, so it showed the size in GB rather than TB.

Relevant code:

private static readonly FrozenDictionary<string, string> units = new Dictionary<string, string>

Steps To Reproduce

See screenshot in #16882.

Files Version

Found on main branch, might have affected released versions

Windows Version

Not relevant

User ID

No response

Log File

Not relevant

Metadata

Metadata

Assignees

No one assigned

    Labels

    area - properties windowFeatures or bug reports for the file permissions page

    Type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions