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:
@@ -577,7 +577,7 @@ static int json_object_double_to_json_string(struct json_object* jso,
|
|||||||
else
|
else
|
||||||
size = snprintf(buf, sizeof(buf), "-Infinity");
|
size = snprintf(buf, sizeof(buf), "-Infinity");
|
||||||
else
|
else
|
||||||
size = snprintf(buf, sizeof(buf), "%f", jso->o.c_double);
|
size = snprintf(buf, sizeof(buf), "%.17g", jso->o.c_double);
|
||||||
|
|
||||||
p = strchr(buf, ',');
|
p = strchr(buf, ',');
|
||||||
if (p) {
|
if (p) {
|
||||||
|
|||||||
Reference in New Issue
Block a user