Copy link to clipboard
Copied
I have some fields that are varchar, however, they have numbers in them. JSON does not return them inside quotation marks because it is interpreting it as a number. Real numbers do not work, either. Is there a workaround?
<cffunction name="jqgridCP" access="remote" returnformat="json">
I'm trying to populate a cfgrid with data from a cfquery. The fields that have numbers as data (not all do) but are varchar in the database return empty cells.
It appears to be adding .0 to the numbers.
Copy link to clipboard
Copied
In the previous releases (including ColdFusion 9), serializing an integer using serializeJSON, converts the number to a double. For example, SerializeJSON (123) returns 123.0.
In ColdFusion 9.0.1, the integer is retained in its original format but enclosed within quotes. That is, SerializeJSON (123) returns "123". This is applicable only to positive integers.
The following table gives more examples:
Input | Serialized JSON |
---|---|
10 | “10” |
012 | “012” |
10.25 | “10.25” |
10.25E5 | “1025000.0” |
10.25E-5 | “1.025E-4” |
-10 | “-10.0” |
-10.25 | “-10.25” |