"For developers", "Server scripts", "Functions description", "JSON", "JSONSetFloat".

 

Create or change the fractional value in JSON object.

 

Syntax

function JSONSetFloat(var sJSON: string; sKey: string; iValue: double): integer;

 

Parameters and return values

Parameter

Type

Value

sJSON

var string

JSON object as a text string;

sKey

string

key name;

iValue

double

key value.

 

Function result

0

no errors;

1

JSON parsing error.

 

Example

var
  sJSON: string;
begin
  sJSON := '{}';
  JSONSetFloat(sJSON, 'CurrentTime', Now);
  mLogScript(sJSON, '');
end.

Script work result

[13:17:04] (Log "JSONSetFloat"): {"CurrentTime":43745.553526794}

[13:17:04] (Run "JSONSetFloat"): Script operation time: 8 ms

[13:17:04] (Run "JSONSetFloat"): Script done successfully.

 

See also

mLogScript

Now