diff options
1 files changed, 9 insertions, 1 deletions
| -rw-r--r-- | ui-tree.c | 10 |
@@ -257,7 +257,15 @@ static int ls_item(const struct object_id *oid, struct strbuf *base, free(buf); strbuf_release(&linkpath); } - htmlf("</td><td class='ls-size'>%li</td>", size); + + if (size < 1024) + htmlf("</td><td class='ls-size'>%li B</td>", size); + else if (size < 1048576) + htmlf("</td><td class='ls-size'>%.1f KiB</td>", (double)size / 1024); + else if (size < 1073741824) + htmlf("</td><td class='ls-size'>%.1f MiB</td>", (double)size / 1048576); + else + htmlf("</td><td class='ls-size'>%.1f GiB</td>", (double)size / 1073741824); html("<td>"); cgit_log_link("log", NULL, "button", ctx.qry.head, |
