1
0
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:
Martin Herkt 2017-12-24 21:26:18 +01:00
parent 79b9f48353
commit 5ffbe2ba8a
No known key found for this signature in database
GPG Key ID: C24B9CD04DC6AE7F

View File

@ -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)