remove WebGUI::Utility::round
This commit is contained in:
parent
ddf0419836
commit
fadc4f34ea
13 changed files with 34 additions and 87 deletions
|
|
@ -23,7 +23,7 @@ use Net::CIDR::Lite;
|
|||
|
||||
our @ISA = qw(Exporter);
|
||||
our @EXPORT = qw(
|
||||
&sortHash &isIn &round
|
||||
&sortHash &isIn
|
||||
);
|
||||
|
||||
|
||||
|
|
@ -39,7 +39,6 @@ This package provides miscellaneous but useful utilities to the WebGUI programme
|
|||
|
||||
use WebGUI::Utility;
|
||||
$boolean = isIn($value, @array);
|
||||
$rounded = round($number, $digits);
|
||||
%hash = sortHash(%hash);
|
||||
|
||||
=head1 METHODS
|
||||
|
|
@ -72,29 +71,6 @@ sub isIn {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 round ( float [, significantDigits ] )
|
||||
|
||||
Returns an integer after rounding a floating point number.
|
||||
|
||||
=head3 float
|
||||
|
||||
Any floating point number.
|
||||
|
||||
=head3 significantDigits
|
||||
|
||||
The number of digits to leave after the decimal point. Defaults to 0.
|
||||
|
||||
B<NOTE:> If you set this higher than 0 then you'll get back another floating point number rather than an integer.
|
||||
|
||||
=cut
|
||||
|
||||
sub round {
|
||||
my $significantDigits = $_[1] || 0;
|
||||
return sprintf(('%.'.$significantDigits.'f'), $_[0]);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 sortHash ( hash )
|
||||
|
||||
Sorts a hash by its values. Returns a Tie::IxHash. You must assign this to
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue