[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58547] trunk/blender/source/blender/ blenlib/intern/storage.c: use binary prefix for file sizes (old todo).
Campbell Barton
ideasman42 at gmail.com
Tue Jul 23 17:01:59 CEST 2013
Revision: 58547
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58547
Author: campbellbarton
Date: 2013-07-23 15:01:59 +0000 (Tue, 23 Jul 2013)
Log Message:
-----------
use binary prefix for file sizes (old todo).
Modified Paths:
--------------
trunk/blender/source/blender/blenlib/intern/storage.c
Modified: trunk/blender/source/blender/blenlib/intern/storage.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/storage.c 2013-07-23 14:55:47 UTC (rev 58546)
+++ trunk/blender/source/blender/blenlib/intern/storage.c 2013-07-23 15:01:59 UTC (rev 58547)
@@ -388,17 +388,14 @@
*/
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);
More information about the Bf-blender-cvs
mailing list