1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-03 20:57:36 +02:00

DibiResult: float detection locale fix [Closes #154]

This commit is contained in:
Petr BAGR Smrkovský
2014-10-30 14:23:26 +01:00
committed by David Grudl
parent 68521d69e3
commit e778096641

View File

@@ -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';