This would help me greatly, thank you
Random number to 4 DP
Moderator: General Moderators
Random number to 4 DP
Does anyone know how to get a random number with a lower bound of 0.0001 and an upper bound of 100.0000 ?
This would help me greatly, thank you
This would help me greatly, thank you
Dunno if this results in what you desire, but a good start perhaps:
Code: Select all
<pre>
<?php
$upperBound = 100.0000;
$lowerBound = 0.0001;
$range = $upperBound-$lowerBound;
$num = $lowerBound + $range * mt_rand(0, 32767)/32767;
echo round($num,4);
?>