small innreport patch

Matus "fantomas" Uhlar uhlar at fantomas.sk
Fri Feb 1 12:54:11 UTC 2002



this makes innreport produce more nice numbers when reporting data
transferret across the day - it displays kB up to 10MB and MB up to 10GB
(not including)

--- innreport.orig      Thu Dec 13 17:39:41 2001
+++ innreport   Thu Jan 31 17:53:33 2002
@@ -2313,9 +2313,9 @@
   my $t;

   $size = 0 unless defined $size;
-  $t = $size / 1024 / 1024 / 1024 > 1 ?
+  $t = $size / 1024 / 1024 / 1024 >= 10 ?
     sprintf "%.1f GB", $size / 1024 / 1024 / 1024 :
-      ($size / 1024 / 1024 > 1 ? sprintf "%.1f MB", $size / 1024 / 1024 :
+      ($size / 1024 / 1024 >= 10 ? sprintf "%.1f MB", $size / 1024 / 1024 :
        sprintf "%.1f KB", $size / 1024);
   return $t;
 }


-- 
 Matus "fantomas" Uhlar, uhlar at fantomas.sk ; http://www.fantomas.sk/
 Warning: I don't wish to receive spam to this address.
 Varovanie: Nezelam si na tuto adresu dostavat akukolvek reklamnu postu.
 The early bird may get the worm, but the second mouse gets the cheese. 


More information about the inn-patches mailing list