better file size format
This commit is contained in:
parent
5c3c0bf07f
commit
071961befa
1 changed files with 3 additions and 2 deletions
3
ccc.c
3
ccc.c
|
@ -306,7 +306,8 @@ long add_file_stat(char *filepath)
|
||||||
bytes /= 1024;
|
bytes /= 1024;
|
||||||
unit++;
|
unit++;
|
||||||
}
|
}
|
||||||
sprintf(size, "%.*f%s", unit, bytes, units[unit]);
|
/* 4 sig fig, limiting characters to have better format */
|
||||||
|
sprintf(size, "%-6.4g %-3s", bytes, units[unit]);
|
||||||
|
|
||||||
/* get file type */
|
/* get file type */
|
||||||
char *type = memalloc(4 * sizeof(char)); /* 3 chars for type */
|
char *type = memalloc(4 * sizeof(char)); /* 3 chars for type */
|
||||||
|
|
Loading…
Reference in a new issue