parson
parson copied to clipboard
Add `char *` representation of `JSONNumber` to handle `bigint`s
Presently parson
converts all JSON's number values into a double
. This means that large bigint
(a.k.a. long long
) values will loose least significant digits (e.g. 35506143
will end up as 3.55061e+07
). In order to still be able to have the "loss-less" representation of the input JSON value, let's keep both double
and char *
versions of it.
This PR implements the above feature, and particularly introduces the following functions:
-
const char * json_value_get_number_as_string (const JSON_Value *value)
-
JSON_Value * json_value_init_number_as_string (const char *number)