Browse Source

Chaning double output from %f to %g to allow seralization of doubles with very large exponents without loosing precision.

pull/59/head
Jorgen Birkler 12 years ago
parent
commit
9790cf2241
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      json_object.c

+ 1
- 1
json_object.c View File

@@ -552,7 +552,7 @@ static int json_object_double_to_json_string(struct json_object* jso,
int level,
int flags)
{
return sprintbuf(pb, "%f", jso->o.c_double);
return sprintbuf(pb, "%.20g", jso->o.c_double);
}

struct json_object* json_object_new_double(double d)


Loading…
Cancel
Save