Changing Thingspeak JSON string data to JSON decimal data
Hi,
I managed to get Thingspeak JSON data from my channel. However, I would like to know if theres any way to convert Thingspeak's JSON string data to decimal. I would really appreciate it if anyone could tell me how to convert it to decimal.
Currently, this is my JSON: { "created_at": "2020-10-08T09:24:00.0000000Z", "entry_id": 1, "field1": "0", "field2": "12", "field3": "1", "field4": "1", "field5": "1", "field6": "1" }
May I know if it is as simple as deleting the ""? For eg,
{ "created_at": "2020-10-08T09:24:00.0000000Z", "entry_id": 1, "field1": 0, "field2": 12, "field3": 1, "field4": 1, "field5": 1, "field6": 1 }
4 Comments
Time DescendingAre you reading the JSON data with a device, or with MATLAB, or with some other code? MATLAB can definitely convert the JSON for you. On a device, you might consider using a JSON library, or reading a single field. When you read a single field, the number is returned as test, which might be easier for you to convert.