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