Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Commit

Permalink
Merge pull request #909 from localheinz/fix/max
Browse files Browse the repository at this point in the history
Fix: Do not pick a random float less than minimum
  • Loading branch information
fzaninotto committed May 9, 2016
2 parents 120198f + 0b8b53b commit 0be0f12
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Faker/Provider/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ public static function randomFloat($nbMaxDecimals = null, $min = 0, $max = null)

if (null === $max) {
$max = static::randomNumber();
if ($min > $max) {
$max = $min;
}
}

if ($min > $max) {
Expand Down

0 comments on commit 0be0f12

Please sign in to comment.