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

This commit is contained in:
Eric Haszlakiewicz
2013-09-11 21:09:43 -05:00
parent a23caf677c
commit 06450206c4

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) {