jsonAddDouble

Adds a decimal number with no key, as an element of an array. Takes json string and value double. Returns modified json via ReturnString.

JSON

Parameters & Returns

Parameters

json String
value Double

Returns

String

Quick Summary

Adds a decimal number with no key, as an element of an array. Takes json string and value double. Returns modified json via ReturnString.

Technical Exegesis...

Adds a decimal number with no key, as an element of an array. Takes json string and value double. Adds a comma first if one is needed, then appends the number, formatted as jsonWriteDouble does. Returns the modified json.

Use between jsonBeginArrayField and jsonEndArrayField for an array of decimal numbers, such as "position": [1.5, 2.25]. jsonWriteDouble always writes a key, so it is for object fields, not array elements.

Example

Example.bam
Local json:String = jsonBegin()
json = jsonBeginArrayField(json, "position")
json = jsonAddDouble(json, 1.5)
json = jsonAddDouble(json, 2.25)
json = jsonEndArrayField(json)
json = jsonEnd(json)
Print json   ; {"position":[1.5,2.25]}