7-Zip-zstd
7-Zip-zstd copied to clipboard
Automatically select the displayed units according to the file size

As shown in the picture, an option can be provided to enable automatic selection of the size units.
For example, the size of "9579" can be displayed as "9.35KB" when the option is turned on, because its size is greater than 1024 bytes and less than 1MB.
Possible pseudo code:
long file_size = xxx;
string displayString;
if (file_size < 1024)
{
// bytes
display = file_size + "byte(s)";
}
else if (file_size < 1024 * 1024)
{
// KB
display = (file_size / 1024) + "KB";
}
else if (file_size < 1024 * 1024 * 1024)
{
// MB
display = (file_size / 1024 / 1024) + "MB";
}
else if (file_size < 1024 * 1024 * 1024 * 1024)
{
// GB
display = (file_size / 1024 / 1024 / 1024) + "GB";
} else if ... // Maybe as high as TB
I know what you mean, could you ask Igor to do this. I don't want to impement to much changes which are not within standard 7-Zip. So both versions are nearly the same ...
Unfortunately, I can't sign up for SourceForge for some reason.
And I noticed that someone raised this question on SourceForge years ago, but there was no response.
I'm eager to have this feature and use zstd at the same time, so I still want to have it if possible.
Maybe in the next release - ok ;)
Thank you very much
1 MB is not 1024^2. Please read about SI and IEC prefixes before filing such a request.
When somebbody wants this feature - please add a PR for it ...