Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit be6e64a8 authored by Rob Swindell's avatar Rob Swindell 💬

Use Math.round() for sizes > 1024 and < 1024000

parent 799124fb
Pipeline #1892 passed with stage
in 7 minutes and 46 seconds
......@@ -14,9 +14,11 @@ function file_size_str(size, bytes, precision)
}
if(size == 0)
return "0K";
if(size <= 1024)
return "1K";
size = size/1024;
if(size<1000) /* KB */
return format("%ldK", Math.ceil(size));
return format("%ldK", Math.round(size));
if(size<100000) /* KB With comma */
return format("%ld,%03ldK",(size/1000),(size%1000));
size = size/1024;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment