SetJSONFloat()

语法

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

参数

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

返回值

无.

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.

示例

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

参阅

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

已支持操作系统

所有

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