When parsing the following JSON string the float value for the x coordinate is being changed.
{ "spatialReference" : { "wkid" : 4326 }, "candidates" : [ { "address" : "240000001", "location" : { "x" : -79.939219121531494, "y" : 40.85215350688开发者_运维知识库9806 }, "score" : 100, "attributes" : { } } ]}
Upon calling JObject.Parse on the preceeding xml it is transformed into
{ "spatialReference": { "wkid": 4326 }, "candidates": [ { "address": "240000001", "location": { "x": -79.9392191215315, "y": 40.852153506889806 }, "score": 100, "attributes": {} } ] }
Is there a way of forcing the parser to treat the x/y values as strings and keep the higher precision?
If you deserialize into a strongly typed object where the x and y properties are decimals then you won't lose any precision.
精彩评论