1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-04 21:28:02 +02:00

DibiResult: fixed detection of "123.000" as float [Closes #67]

This commit is contained in:
David Grudl
2013-04-03 14:38:12 +02:00
parent 67f8468a38
commit c399d79ab8

View File

@@ -514,7 +514,7 @@ class DibiResult extends DibiObject implements IDataSource
$row[$key] = is_float($tmp = $value * 1) ? $value : $tmp;
} elseif ($type === dibi::FLOAT) {
$row[$key] = (string) ($tmp = (float) $value) === $value ? $tmp : $value;
$row[$key] = (string) ($tmp = (float) $value) === rtrim(rtrim($value, '0'), '.') ? $tmp : $value;
} elseif ($type === dibi::BOOL) {
$row[$key] = ((bool) $value) && $value !== 'f' && $value !== 'F';