How do I get a number out of a JSON file with JSONObject.cs

I am trying to get a number from a JSON file using JSONObject.cs from the unity [wiki][1]
but I’m having some trouble. I am able to print the number from the json file using JSONObject.cs but saving that number in a variable is not working because unity says that the thing I have been printing is a JSONObject not a number. So here is some of my code if it helps.

var cParsedData: JSONObject = new JSONObject(textStringData);
print(cParsedData[0]~~[attributePos);//this prints a number~~

var tempNum: double = cParsedData[0][0][attributePos].double;
Any ideas?

If you are sure it’s a number, just assign it to the double variable. The value should be implicitly casted:

var tempNum: double = cParsedData[0][0][attributePos];