WebGUI 2.0.0 release
This commit is contained in:
parent
6cf30b32bd
commit
08a5f757da
10 changed files with 101 additions and 32 deletions
|
|
@ -18,7 +18,7 @@ use WebGUI::Session;
|
|||
use WebGUI::SQL;
|
||||
|
||||
our @ISA = qw(Exporter);
|
||||
our @EXPORT = qw(&getNextId &saveAttachment &round &urlizeTitle "e);
|
||||
our @EXPORT = qw(&randint &getNextId &saveAttachment &round &urlizeTitle "e);
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
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]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue