Parsing with the Arduino_JSON.h library

I'm able to print parsed values to Serial using this example. The relevant section of the code is at the bottom of the post. Are there ways to store the data as other types of variables so I can do other things like post to ThingSpeak? I was able to store the data in a form that would post to ThingSpeak by adding these long variables. This cuts everything off after the decimal, though, and I'd like to avoid that. Are there solutions while still keeping this library? I see a lot of examples using ArduinoJson.h instead. Do I need to learn how to use that one to do what I want?

  long outsideTemp = myObject[String("main")][String("temp")];
  long outsideHumidity = myObject[String("main")][String("humidity")];
String serverPath = "" + city + "," + state + "," + countryCode + "&units=imperial" + "&APPID=" + ApiKey;
  jsonBuffer = httpGETRequest(serverPath.c_str());
  JSONVar myObject = JSON.parse(jsonBuffer);
  if (JSON.typeof(myObject) == "undefined") {
    Serial.println("Parsing input failed!");
  Serial.print("JSON object = ");
  Serial.print("Temperature: ");
  Serial.print("Pressure: ");
  Serial.print("Humidity: ");
  Serial.print("Wind Speed: ");

I'm able to use double which will work for my purposes here. Not sure if I'll run into a future situation where I'll want to use String or one of the other types that don't seem to work.

You can give String() function a decimal, when Numbers also has that: So String(value,5) will also give you 5 decimal places. Maybe try that Out.

You mind showing us your json?

I am able to use the string function, but I have to create a double variable first and convert that.

The attached code pulls outside weather data from and collects temp and humidity from 6 ESP8266 ESP-01’s scattered around my place. This data is then posted to ThingSpeak every 15 seconds. The json section is at the top of the sendInfo() function.

forum_example_2.ino (10.9 KB)