From 243ed78eb395ee0be985c2a2af20e260b7dc395f Mon Sep 17 00:00:00 2001 From: cxl Date: Fri, 28 Jun 2013 09:36:04 +0000 Subject: [PATCH] CtrlLib: Improved filesize formatting (thanks klugier) git-svn-id: svn://ultimatepp.org/upp/trunk@6157 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CtrlLib/FileSel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uppsrc/CtrlLib/FileSel.cpp b/uppsrc/CtrlLib/FileSel.cpp index 7992030f6..24b6be2ac 100644 --- a/uppsrc/CtrlLib/FileSel.cpp +++ b/uppsrc/CtrlLib/FileSel.cpp @@ -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() {