remove WebGUI::Utility::formatBytes

This commit is contained in:
Graham Knop 2010-08-20 12:09:58 -05:00
parent 42784e1b98
commit 006a5003c2
8 changed files with 13 additions and 39 deletions

View file

@ -23,7 +23,7 @@ use Net::CIDR::Lite;
our @ISA = qw(Exporter);
our @EXPORT = qw(&isBetween &makeTabSafe &makeArrayTabSafe &randomizeHash &commify &randomizeArray &isInSubnet
&formatBytes &sortHashDescending &sortHash &isIn &makeCommaSafe &makeArrayCommaSafe &randint &round &scalarEquals
&sortHashDescending &sortHash &isIn &makeCommaSafe &makeArrayCommaSafe &randint &round &scalarEquals
);
@ -39,7 +39,6 @@ This package provides miscellaneous but useful utilities to the WebGUI programme
use WebGUI::Utility;
$string = commify($integer);
$size = formatBytes($integer);
$boolean = isBetween($value, $first, $second);
$boolean = isIn($value, @array);
$boolean = isInSubnet($ip, \@subnets);
@ -92,30 +91,6 @@ sub emailRegex {
}
#-------------------------------------------------------------------
=head2 formatBytes ( integer )
Returns a formatted file size like "3MB" or "44kB".
=head3 integer
An integer representing the number of bytes to format.
=cut
sub formatBytes {
my $size = shift;
if ($size > 1048576) {
return round($size/1048576).' MB';
} elsif ($size > 1024) {
return round($size/1024).' kB';
} else {
return $size.' B';
}
}
#-------------------------------------------------------------------
=head2 isBetween ( value, first, second )