WebGUI 2.0.0 release

This commit is contained in:
JT Smith 2001-10-06 22:37:00 +00:00
parent 6cf30b32bd
commit 08a5f757da
10 changed files with 101 additions and 32 deletions

View file

@ -18,7 +18,7 @@ use WebGUI::Session;
use WebGUI::SQL;
our @ISA = qw(Exporter);
our @EXPORT = qw(&getNextId &saveAttachment &round &urlizeTitle &quote);
our @EXPORT = qw(&randint &getNextId &saveAttachment &round &urlizeTitle &quote);
#-------------------------------------------------------------------
sub getNextId {
@ -35,6 +35,15 @@ sub quote {
return $session{dbh}->quote($value);
}
#-------------------------------------------------------------------
sub randint {
my ($low, $high) = @_;
$low = 0 unless defined $low;
$high = 1 unless defined $high;
($low, $high) = ($high,$low) if $low > $high;
return $low + int( rand( $high - $low + 1 ) );
}
#-------------------------------------------------------------------
sub round {
return sprintf("%.0f", $_[0]);