Package: xdiskusage / 1.48-10.1

06_xdiskusage.C_used_Ki_Mi_Gi.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
--- a/xdiskusage.C
+++ b/xdiskusage.C
@@ -55,9 +55,9 @@
 // turn number of K into user-friendly text:
 const char* formatk(ull k) {
   static char buffer[10];
-  if (k >= 1024*1024) sprintf(buffer,"%.4gG",(double)k/(1024*1024));
-  else if (k >= 1024) sprintf(buffer,"%.4gM",(double)k/1024);
-  else sprintf(buffer,"%.0fK",(double)k);
+  if (k >= 1024*1024) sprintf(buffer,"%.4gGi",(double)k/(1024*1024));
+  else if (k >= 1024) sprintf(buffer,"%.4gMi",(double)k/1024);
+  else sprintf(buffer,"%.0fKi",(double)k);
   return buffer;
 }