Retain original form of numbers when stringifying

This commit is contained in:
Eric Fischer 2016-01-27 14:41:06 -08:00
parent 167beae307
commit 0e59a4f774

View File

@ -661,11 +661,7 @@ static void json_print_one(struct string *val, json_object *o) {
string_append(val, '\"');
} else if (o->type == JSON_NUMBER) {
char *s;
if (asprintf(&s, "%f", o->number) >= 0) {
string_append_string(val, s);
free(s);
}
string_append_string(val, o->string);
} else if (o->type == JSON_NULL) {
string_append_string(val, "null");
} else if (o->type == JSON_TRUE) {