SetJSONFloat()

Syntax

SetJSONFloat(JSONValue, Value.f)
Description
Change the type of the JSON value to #PB_JSON_Number and store the given float value.

Parameters

JSONValue The JSON value.
Value.f The value to store.

Return value

None.

Remarks

Note that JSON does not permit the special floating point values +Infinity, -Infinity or NaN in JSON data. If such a value is set with this function, it will be replaced by a JSON 'null' literal when the data is being saved or encoded. The functions IsInfinity() or IsNaN() can be used to detect this case.

Example

  If CreateJSON(0)
    ArrayValue = SetJSONArray(JSONValue(0))
    SetJSONFloat(AddJSONElement(ArrayValue), 1.23)
    SetJSONFloat(AddJSONElement(ArrayValue), 4.56)
    
    Debug ComposeJSON(0)
  EndIf

See Also

GetJSONFloat(), SetJSONArray(), SetJSONBoolean(), SetJSONDouble(), SetJSONInteger(), SetJSONNull(), SetJSONObject(), SetJSONString(), SetJSONQuad()

Supported OS

All

<- SetJSONDouble() - Json Index - SetJSONInteger() ->