mirror of
https://github.com/mpv-player/mpv
synced 2025-01-03 05:22:23 +00:00
command: use IEC symbols for file size formatting
This commit is contained in:
parent
79b9f48353
commit
5ffbe2ba8a
@ -327,15 +327,15 @@ static char *format_file_size(int64_t size)
|
||||
return talloc_asprintf(NULL, "%.0f", s);
|
||||
|
||||
if (size < (1024 * 1024))
|
||||
return talloc_asprintf(NULL, "%.3f Kb", s / (1024.0));
|
||||
return talloc_asprintf(NULL, "%.3f KiB", s / (1024.0));
|
||||
|
||||
if (size < (1024 * 1024 * 1024))
|
||||
return talloc_asprintf(NULL, "%.3f Mb", s / (1024.0 * 1024.0));
|
||||
return talloc_asprintf(NULL, "%.3f MiB", s / (1024.0 * 1024.0));
|
||||
|
||||
if (size < (1024LL * 1024LL * 1024LL * 1024LL))
|
||||
return talloc_asprintf(NULL, "%.3f Gb", s / (1024.0 * 1024.0 * 1024.0));
|
||||
return talloc_asprintf(NULL, "%.3f GiB", s / (1024.0 * 1024.0 * 1024.0));
|
||||
|
||||
return talloc_asprintf(NULL, "%.3f Tb", s / (1024.0 * 1024.0 * 1024.0 * 1024.0));
|
||||
return talloc_asprintf(NULL, "%.3f TiB", s / (1024.0 * 1024.0 * 1024.0 * 1024.0));
|
||||
}
|
||||
|
||||
static char *format_delay(double time)
|
||||
|
Loading…
Reference in New Issue
Block a user