Render the number nicely from the given item into a string. */
| 182 | |
| 183 | /* Render the number nicely from the given item into a string. */ |
| 184 | static char *print_double(cJSON *item) |
| 185 | { |
| 186 | char *str; |
| 187 | double d = item->valuedouble; |
| 188 | str = (char*) cJSON_malloc(64); /* This is a nice tradeoff. */ |
| 189 | if (str) |
| 190 | { |
| 191 | sprintf(str, "%.15f", d); |
| 192 | } |
| 193 | return str; |
| 194 | } |
| 195 | |
| 196 | static char *print_int(cJSON *item) |
| 197 | { |