I am trying to desrialize a json into a datatable. My JSON looks like below: [{ "Id": 35, "Name": "ABC", "XVar": 0.078814, "YVar": 1 }, { "Id": 79, "Name": "XYZ", "XVar": 1.50, "YVar": 30.2 }]
I'm using the following code to deserialize: var dataTable = (DataTable)JsonConvert.DeserializeObject(jsonString, (typeof(DataTable)));
The problem is that the Y value for the second object is serialized as 30 and not 30.2. What is the simplest thing I can do to preserve the data. All ideas are welcome.