Skip to content

Lost precision in double values #11

@guillaumechereau

Description

@guillaumechereau

I would like to use json-builder for a project that sometime has to export time in julian date (as a number of day + fraction of day). The values need to keep a high precision (at least 6 digits after the coma), but currently json-builder doesn't handle this case very well, because the '%g' format used in the code will for example convert "55080.708333" to "55080.7"

I wish there was an option to specify the format used. Maybe a string in json_serialize_opts to override the "%g" ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions