summaryrefslogtreecommitdiff
path: root/xs_json.h
diff options
context:
space:
mode:
Diffstat (limited to 'xs_json.h')
-rw-r--r--xs_json.h19
1 files changed, 1 insertions, 18 deletions
diff --git a/xs_json.h b/xs_json.h
index 871dfcf..13c3ebb 100644
--- a/xs_json.h
+++ b/xs_json.h
@@ -91,24 +91,7 @@ d_char *_xs_json_dumps(d_char *s, char *data, int level, int indent)
break;
case XSTYPE_NUMBER:
- {
- char tmp[32];
- snprintf(tmp, sizeof(tmp), "%.15f", xs_number_get(data));
-
- /* strip useless zeros */
- if (strchr(tmp, '.') != NULL) {
- char *ptr;
-
- for (ptr = tmp + strlen(tmp) - 1; *ptr == '0'; ptr--);
-
- if (*ptr != '.')
- ptr++;
-
- *ptr = '\0';
- }
-
- s = xs_str_cat(s, tmp);
- }
+ s = xs_str_cat(s, xs_number_str(data));
break;
case XSTYPE_LIST: