Feature request: Preference: To choose between SI and Binary Unit

Feature request: Preference: To choose between SI and Binary Unit

For anybody in doubt: Files uses SI units (base 10). I.e., 64,000 bytes is shown as 64.0 KB. With binary units (base 2) that would instead be 62.5 KiB and 64 .0 KiB would be 65,536 bytes.

Can you provide a use-case for this? What would users want to see the size in binary units for?

@jakedane I have updated my answer:

Most CLI tools provide binary units as default, such as ls, sgdisk, lvreduce, lvextend, lsblk, df, lvs.

Partitions and logical volumes can only be defined in SI units while creating them (or in Bytes as a multiple of 512). For example one can create 20 GiB of a partition but not 20 GB of Partition because it is not a multiple of 512!

So it might be easier to compare the disk space with file space, when the Disc space is simple number (with mostly 0’s as all digits except the most significant digit).

Disk manufacturers use SI units for advertising storage capacity so I would rather lean the other way :slight_smile:

For example I have a 128 GB USB thumb drive. That’s what’s printed on the outside. In Files if I look at properties it shows the same for total. Also in the Disks app with which I formatted the USB it shows size as 128 GB. But for example GParted uses binary units and it shows it as 119 GiB—confusing because that doesn’t match the capacity printed on the outside.

Does it matter much so long as Files uses the same type of unit for file sizes as it uses for partition total / used / free sizes?

As for creating a 20 GB partition, as with any partitioning, that aligns the partition start and end to the closest boundary. So the partition size won’t be 20.000.000.000 bytes exactly but rather (assuming 1 MiB boundary) 20.000.538.624 bytes.

The example you quoted works good as 128 GB is an exact multiple of 512 Bytes without any fraction.

May be we could provide option in preference to let user decide what unit they want to use instead of we making this choice? May be its not that useful to debate about it, just let user choose?

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.