summaryrefslogtreecommitdiff
path: root/json_object.c
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2012-12-13 11:46:04 +0100
committerRemi Collet <fedora@famillecollet.com>2012-12-13 11:46:04 +0100
commit32d149c8f60a5bdad4f678013a83d052ffd8ad43 (patch)
tree33bdc57adf2fd21a75aab5f3f86261899d35b4c2 /json_object.c
parent8c847968c7de17be6cf3878a4e6adca8ab8d8f14 (diff)
probably worth an option for this
Diffstat (limited to 'json_object.c')
-rw-r--r--json_object.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/json_object.c b/json_object.c
index b078017..9161b00 100644
--- a/json_object.c
+++ b/json_object.c
@@ -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++) {