Currently, in terms of extracting numbers from JSON, only int and float types are supported.
When I need to extract numbers from JSON into decimal types without precision loss, I need to work around by requesting the number value as a string and then casting it to value of a decimal type. In order to not cause a cast exception, I need to first try and extract the value as a float. This clutters my code and requires me to call queryJSON() twice, as in this example:
Currently, in terms of extracting numbers from JSON, only
int
andfloat
types are supported. When I need to extract numbers from JSON intodecimal
types without precision loss, I need to work around by requesting the number value as a string and then casting it to value of a decimal type. In order to not cause a cast exception, I need to first try and extract the value as afloat
. This clutters my code and requires me to call queryJSON() twice, as in this example:Instead, I would like to be able to replace all this by simply calling: