1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-06 22:26:43 +02:00

Result: improved normalization of int

This commit is contained in:
David Grudl
2015-10-13 14:13:29 +02:00
parent ee5f1dd293
commit 19748f7c5b

View File

@@ -492,7 +492,9 @@ class DibiResult extends DibiObject implements IDataSource
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');