X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FUI%2FWeb.pm;h=0597a385e1445fbf2854e1f4eba7faeb4d0bc40f;hb=dbb388836b7951a3db49deda05a1ff9ba5125c17;hp=c9eaf50120d959d8c8e1b74e22e13280cd37c054;hpb=39fd666a49b2be516967131a46891f17ce0101da;p=freeside.git diff --git a/FS/FS/UI/Web.pm b/FS/FS/UI/Web.pm index c9eaf5012..0597a385e 100644 --- a/FS/FS/UI/Web.pm +++ b/FS/FS/UI/Web.pm @@ -64,6 +64,17 @@ sub parse_lt_gt { } +sub bytecount_unexact { + my $bc = shift; + return("$bc bytes") + if ($bc < 1000); + return(sprintf("%.2f Kbytes", $bc/1000)) + if ($bc < 1000000); + return(sprintf("%.2f Mbytes", $bc/1000000)) + if ($bc < 1000000000); + return(sprintf("%.2f Gbytes", $bc/1000000000)); +} + ### # cust_main report subroutines ###