Reference+
Name
getFloat()
Class
JSONArray
Description
Gets the float value associated with the specified index.
Examples
// The following short JSON file called "data.json" is parsed // in the code below. It must be in the project's "data" folder. // // [ 32, 1.13, "grape", true ] JSONArray json; void setup() { json = loadJSONArray("data.json"); int count = json.getInt(0); float weight = json.getFloat(1); String name = json.getString(2); boolean isFruit = json.getBoolean(3); println(count + ", " + weight + ", " + name + ", " + isFruit); } // Sketch prints: // 32, 1.13, grape, true
Syntax
.getFloat(index)
.getFloat(index, defaultValue)
Parameters
index
(int)
must be between 0 and length() - 1
Return
float
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.