diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-07-23 19:01:59 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-07-23 19:01:59 +0400 |
commit | e1928790ae41b1038f45a1100729868f49d3379a (patch) | |
tree | 794c5a37ee5f5aacd718613a29d329176e0895b5 /source/blender/blenlib/intern | |
parent | b05d5ed657775f68cab66d8c9b90b8ebad8c5dbd (diff) |
use binary prefix for file sizes (old todo).
Diffstat (limited to 'source/blender/blenlib/intern')
-rw-r--r-- | source/blender/blenlib/intern/storage.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index aeeae000fff..34c6e632131 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -388,17 +388,14 @@ static void bli_adddirstrings(struct BuildDirCtx *dir_ctx) */ st_size = file->s.st_size; - /* FIXME: Either change decimal prefixes to binary ones - * <http://en.wikipedia.org/wiki/Binary_prefix>, or change - * divisor factors from 1024 to 1000. */ if (st_size > 1024 * 1024 * 1024) { - BLI_snprintf(file->size, sizeof(file->size), "%.2f GB", ((double)st_size) / (1024 * 1024 * 1024)); + BLI_snprintf(file->size, sizeof(file->size), "%.2f GiB", ((double)st_size) / (1024 * 1024 * 1024)); } else if (st_size > 1024 * 1024) { - BLI_snprintf(file->size, sizeof(file->size), "%.1f MB", ((double)st_size) / (1024 * 1024)); + BLI_snprintf(file->size, sizeof(file->size), "%.1f MiB", ((double)st_size) / (1024 * 1024)); } else if (st_size > 1024) { - BLI_snprintf(file->size, sizeof(file->size), "%d KB", (int)(st_size / 1024)); + BLI_snprintf(file->size, sizeof(file->size), "%d KiB", (int)(st_size / 1024)); } else { BLI_snprintf(file->size, sizeof(file->size), "%d B", (int)st_size); |