Skip to content

Commit

Permalink
Result: improved normalization of int
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Oct 13, 2015
1 parent ee5f1dd commit 19748f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dibi/libs/DibiResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,9 @@ private function normalize(array & $row)
if ($value === FALSE || $type === dibi::TEXT) {

} elseif ($type === dibi::INTEGER) {
$row[$key] = is_float($tmp = $value * 1) ? $value : $tmp;
$row[$key] = is_float($tmp = $value * 1)
? (is_string($value) ? $value : (int) $value)
: $tmp;

} elseif ($type === dibi::FLOAT) {
$value = ltrim($value, '0');
Expand Down

0 comments on commit 19748f7

Please sign in to comment.