Skip to content

Bug: formatting real values for locales with ',' decimal separator #567

Closed
@siddie

Description

@siddie

JsonWriter (89ab7ec on 27 Oct), line 155:

// try to ensure we preserve the fact that this was given to us as a double on input if (!strstr(buffer, ".") && !strstr(buffer, "e")) { strcat(buffer, ".0"); }

Let
a = 0.1;
this piece of code gives me
buffer == "0,1.0"
then after fixNumericLocale i get
buffer == "0.1.0"

and this value is actually written to json.

The straigttforward way of fixing it is obvious, but I think you should generalize your way of working with locales.

Anyway, thank you for this good lib.

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