Skip to content

double fetch()ed as string #289

@Honzy

Description

@Honzy

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 210

Expected Behavior

Return float

Possible Solution

$row[$key] = preg_match("/^-{0,1}\d+\.\d+$/", $value) === 1 ? $float : $value;

double

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions