Browse Source

Issue #59: change the floating point output format to %.17g so values with more than 6 digits show up in the output.

tags/json-c-0.12-20140410
Eric Haszlakiewicz 12 years ago
parent
commit
06450206c4
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      json_object.c

+ 1
- 1
json_object.c View File

@@ -577,7 +577,7 @@ static int json_object_double_to_json_string(struct json_object* jso,
else
size = snprintf(buf, sizeof(buf), "-Infinity");
else
size = snprintf(buf, sizeof(buf), "%f", jso->o.c_double);
size = snprintf(buf, sizeof(buf), "%.17g", jso->o.c_double);

p = strchr(buf, ',');
if (p) {


Loading…
Cancel
Save