I'm using this code:
const size_t bufferSize = JSON_OBJECT_SIZE(2) + 2*JSON_OBJECT_SIZE(3) + JSON_OBJECT_SIZE(7);
DynamicJsonBuffer jsonBuffer(bufferSize);
JsonObject& root = jsonBuffer.createObject();
JsonObject& loc = root.createNestedObject("loc");
loc["lat"] = 45.123456;
loc["lng"] = 54.654321;
And I'm getting in the output this:
{"loc":{"lat":45.12346,"lng":54.65432}}
But when I change values to strings ("xx.xxxxxx"), it works normally, just giving me a string instead of a double. Why am I missing that 5 and 1?