From e778096641922e8df05372a4f9ebde2392548e2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20BAGR=20Smrkovsk=C3=BD?= Date: Thu, 30 Oct 2014 14:23:26 +0100 Subject: [PATCH] DibiResult: float detection locale fix [Closes #154] --- 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 8ab1064e..2dcd4a61 100644 --- a/dibi/libs/DibiResult.php +++ b/dibi/libs/DibiResult.php @@ -500,7 +500,7 @@ class DibiResult extends DibiObject implements IDataSource $row[$key] = is_float($tmp = $value * 1) ? $value : $tmp; } elseif ($type === dibi::FLOAT) { - $row[$key] = ltrim((string) ($tmp = (float) $value), '0') === ltrim(rtrim(rtrim($value, '0'), '.'), '0') ? $tmp : $value; + $row[$key] = str_replace(',', '.', ltrim((string) ($tmp = (float) $value), '0')) === ltrim(rtrim(rtrim($value, '0'), '.'), '0') ? $tmp : $value; } elseif ($type === dibi::BOOL) { $row[$key] = ((bool) $value) && $value !== 'f' && $value !== 'F';