add min/max size entries to adv search + convert size display to decimal (instead of 1024-based)

This commit is contained in:
Jean-Francois Dockes
2012-03-07 17:52:32 +01:00
parent 7ddbbb1ee8
commit 420157d998
4 changed files with 76 additions and 6 deletions
+6 -6
View File
@@ -594,17 +594,17 @@ string displayableBytes(off_t size)
char sizebuf[50];
const char *unit;
if (size < 1024) {
if (size < 1000) {
unit = " B ";
} else if (size < 1024*1024) {
} else if (size < 1E6) {
unit = " KB ";
size /= 1024;
} else if (size < 1024*1024*1024) {
size /= 1000;
} else if (size < 1E9) {
unit = " MB ";
size /= (1024*1024);
size /= (1E6);
} else {
unit = " GB ";
size /= (1024*1024*1024);
size /= (1E9);
}
sprintf(sizebuf, OFFTPC "%s", size, unit);