Add more docs to the Splat_random macro. Change the macro to use Perl's

scaling function of rand instead of an implicit multiply.
This commit is contained in:
Colin Kuskie 2006-07-23 06:17:31 +00:00
parent 746ccf43bb
commit 7033959b5e
2 changed files with 6 additions and 5 deletions

View file

@ -35,13 +35,14 @@ used as a default.
#-------------------------------------------------------------------
sub process {
my $session = shift;
my ($temp, @param);
my ($temp, @param, $limit);
@param = @_;
if ($param[0] ne "") {
$temp = round(rand()*$param[0]);
$limit = $param[0];
} else {
$temp = round(rand()*1000000000);
$limit = 1000000000;
}
$temp = round(rand($limit));
return $temp;
}

View file

@ -16,10 +16,10 @@ our $I18N = {
message => q|
<p><b>&#94;*; or &#94;*(); - Random Number</b><br />
A randomly generated number. This is often used on images (such as banner ads) that you want to ensure do not cache. In addition, you may configure this macro like this <b>&#94;*(100);</b> to create a random number between 0 and 100.
A randomly generated, whole number between 0 and the number you send the Macro. This is often used on images (such as banner ads) that you want to ensure do not cache. You may configure this macro like this <b>&#94;*(100);</b> to create a random number between 0 and 100. If no number is sent a default of 1 billion (1,000,000,000) will be used.
</p>
|,
lastUpdated => 1146608648,
lastUpdated => 1153635269,
},
};