probably worth an option for this

This commit is contained in:
Remi Collet
2012-12-13 11:46:04 +01:00
parent 8c847968c7
commit 32d149c8f6
3 changed files with 7 additions and 2 deletions

View File

@@ -562,7 +562,7 @@ static int json_object_double_to_json_string(struct json_object* jso,
} else {
p = strchr(buf, '.');
}
if (p) {
if (p && (flags & JSON_C_TO_STRING_NOZERO)) {
/* last useful digit, always keep 1 zero */
p++;
for (q=p ; *q ; q++) {