Skip to content
Snippets Groups Projects
Commit 532c32c8 authored by Yorhel's avatar Yorhel
Browse files

Add space between file size and unit suffix

parent 0e9e6d51
No related branches found
No related tags found
No related merge requests found
...@@ -142,8 +142,8 @@ static void browse_draw_item(struct dir *n, int row) { ...@@ -142,8 +142,8 @@ static void browse_draw_item(struct dir *n, int row) {
x = 0; x = 0;
mvprintw(row, x, "%c %8s ", ct, size); mvprintw(row, x, "%c %9s ", ct, size);
x += 11; x += 12;
if (show_items) { if (show_items) {
if (n->items > 99999) if (n->items > 99999)
...@@ -169,7 +169,7 @@ static void browse_draw_item(struct dir *n, int row) { ...@@ -169,7 +169,7 @@ static void browse_draw_item(struct dir *n, int row) {
void browse_draw() { void browse_draw() {
struct dir *t; struct dir *t;
char fmtsize[9], *tmp; char fmtsize[10], *tmp;
int selected = 0, i; int selected = 0, i;
erase(); erase();
......
...@@ -58,7 +58,7 @@ char *cropstr(const char *from, int s) { ...@@ -58,7 +58,7 @@ char *cropstr(const char *from, int s) {
char *formatsize(int64_t from) { char *formatsize(int64_t from) {
static char dat[9]; /* "xxx.xMiB" */ static char dat[10]; /* "xxx.x MiB" */
float r = from; float r = from;
char c = ' '; char c = ' ';
if (si) { if (si) {
...@@ -69,7 +69,7 @@ char *formatsize(int64_t from) { ...@@ -69,7 +69,7 @@ char *formatsize(int64_t from) {
else if(r < 1e15f){ c = 'T'; r/=1e12f; } else if(r < 1e15f){ c = 'T'; r/=1e12f; }
else if(r < 1e18f){ c = 'P'; r/=1e15f; } else if(r < 1e18f){ c = 'P'; r/=1e15f; }
else { c = 'E'; r/=1e18f; } else { c = 'E'; r/=1e18f; }
sprintf(dat, "%5.1f%cB", r, c); sprintf(dat, "%5.1f %cB", r, c);
} }
else { else {
if(r < 1000.0f) { } if(r < 1000.0f) { }
...@@ -79,7 +79,7 @@ char *formatsize(int64_t from) { ...@@ -79,7 +79,7 @@ char *formatsize(int64_t from) {
else if(r < 1023e12f){ c = 'T'; r/=1099511627776.0f; } else if(r < 1023e12f){ c = 'T'; r/=1099511627776.0f; }
else if(r < 1023e15f){ c = 'P'; r/=1125899906842624.0f; } else if(r < 1023e15f){ c = 'P'; r/=1125899906842624.0f; }
else { c = 'E'; r/=1152921504606846976.0f; } else { c = 'E'; r/=1152921504606846976.0f; }
sprintf(dat, "%5.1f%c%cB", r, c, c == ' ' ? ' ' : 'i'); sprintf(dat, "%5.1f %c%cB", r, c, c == ' ' ? ' ' : 'i');
} }
return dat; return dat;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment