CtrlLib: Improved filesize formatting (thanks klugier)

git-svn-id: svn://ultimatepp.org/upp/trunk@6157 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2013-06-28 09:36:04 +00:00
parent 9647cb1b7e
commit 243ed78eb3

View file

@ -1117,12 +1117,12 @@ String FormatFileSize(int64 n)
return Format("%d B ", n);
else
if(n < 10000 * 1024)
return Format("%d K ", n >> 10);
return Format("%d.%d K ", n >> 10, (n & 1023) / 103);
else
if(n < I64(10000000) * 1024)
return Format("%d M ", n >> 20);
return Format("%d.%d M ", n >> 20, (n & 1023) / 103);
else
return Format("%d G ", n >> 30);
return Format("%d.%d G ", n >> 30, (n & 1023) / 103);
}
void FileSel::Update() {