Closed Honzy closed 2 years ago
Version: 3.1.4
Double in database is returned as string.
Double with a lot of zeros is returned as string (f.e. 0.000074601974431321)
(float)0.000074601974431321 -> 7.4601974431321e-5 $row[$key] = (string) $float === $value ? $float : $value;// FALSE, return string -> Helpers->normalizeRow() row 210
$row[$key] = (string) $float === $value ? $float : $value;
Return float
$row[$key] = preg_match("/^-{0,1}\d+\.\d+$/", $value) === 1 ? $float : $value;
Version: 3.1.4
Bug Description
Double in database is returned as string.
Steps To Reproduce
Double with a lot of zeros is returned as string (f.e. 0.000074601974431321)
(float)0.000074601974431321 -> 7.4601974431321e-5
$row[$key] = (string) $float === $value ? $float : $value;
// FALSE, return string -> Helpers->normalizeRow() row 210Expected Behavior
Return float
Possible Solution
$row[$key] = preg_match("/^-{0,1}\d+\.\d+$/", $value) === 1 ? $float : $value;