Skip to content

Better handling of floats with json_encode #10433

@tgeene

Description

@tgeene

Description

When using the function json_encode it will sometime lose all precision on floats being used as values. It would be nice if a new constant was added that handled similar to JSON_BIGINT_AS_STRING such as JSON_FLOAT_AS_STRING. I recommend this solution as I don't know if simply maintain precision would be possible given the underlying code of PHP.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions