From c399d79ab80d093315d407c72abd93a1ee72bf19 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Wed, 3 Apr 2013 14:38:12 +0200 Subject: [PATCH] DibiResult: fixed detection of "123.000" as float [Closes #67] --- dibi/libs/DibiResult.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dibi/libs/DibiResult.php b/dibi/libs/DibiResult.php index cca00a0e..c62ae086 100644 --- a/dibi/libs/DibiResult.php +++ b/dibi/libs/DibiResult.php @@ -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';