Skip to content

Commit

Permalink
Float fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgerobles committed Apr 22, 2018
1 parent fe75ce6 commit 6035cb2
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ public function getDb()
* @param boolean $partialMatch
* @return EMongoCriteria
*/
public function compare($column, $value = null, $partialMatch = false, $cast=null)
public function compare($column, $value = null, $partialMatch = false)
{
$query = array();

Expand All @@ -390,14 +390,9 @@ public function compare($column, $value = null, $partialMatch = false, $cast=nul
)
){
$value = (int)$value;
}
}

switch($cast){
case 'float':
} elseif(preg_match('@[0-9]*(\.[0-9]+)?@si',$value)){
$value=(float)$value;
break;
//@todo, other types
}
}

switch($op){
Expand Down Expand Up @@ -569,4 +564,4 @@ public function toArray($onlyCondition = false)
}
return $result;
}
}
}

0 comments on commit 6035cb2

Please sign in to comment.