I have changed the calculation of the human-readable file size representation that follows units of IEC 60027-2 A.2 (depicted from the chosen unit (see https://en.wikipedia.org/wiki/Binary_prefix). I also have extended the calculation to represent K/M/G/T/... dynamically based on the file size, because I had a value of something like 12345 GiB free space displayed.
I have also compared this to what different operation systems do, so Windows 10/11 and Debian/Ubuntu command line output uses the binary representation:
root@ytldp /srv # ls -all /srv/test
-rwxr-xr-x 1 ytdlp ytdlp 19648957 Mar 2 23:59 yt-dlp-webui
root@ytldp /srv # ls -all -h /srv/test
-rwxr-xr-x 1 ytdlp ytdlp 19M Mar 2 23:59 yt-dlp-webui
Windows 10/11:
2024-03-02 23:59 19.648.957 yt-dlp-webui
--> is shown in GUI as: 19.189 KB
However Windows and Debian/Ubuntu (shell) displays units following JEDEC writing and not IEC writing.
I have changed the calculation of the human-readable file size representation that follows units of IEC 60027-2 A.2 (depicted from the chosen unit (see https://en.wikipedia.org/wiki/Binary_prefix). I also have extended the calculation to represent K/M/G/T/... dynamically based on the file size, because I had a value of something like 12345 GiB free space displayed.
I have also compared this to what different operation systems do, so Windows 10/11 and Debian/Ubuntu command line output uses the binary representation:
However Windows and Debian/Ubuntu (shell) displays units following JEDEC writing and not IEC writing.