Skip to content

Commit

Permalink
DibiResult: float detection locale fix [Closes #154]
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr BAGR Smrkovský authored and dg committed Jan 13, 2015
1 parent 68521d6 commit e778096
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dibi/libs/DibiResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ private function normalize(array & $row)
$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';
Expand Down

0 comments on commit e778096

Please sign in to comment.