TryDouble

Native Pascal, workflow preparation

Description

Converts a wjNumber node to a Double when its stored text is a valid JSON number; the decimal point and exponent are read directly from the text, independent of the system locale. Results that overflow or otherwise come out non-finite are rejected.

An invalid spelling, an empty text, or a node of another kind returns False and leaves Value at 0.

Syntax

Delphi

Function TPLWorkflowJSON.TryDouble(Out Value: Double): Boolean;

Parameters

ValueReceives the converted number; set to 0 when the conversion fails

Return values

TrueThe node is a number with a valid spelling and Value holds the finite result
FalseThe node is not a number, its spelling is invalid, or the result is non-finite; Value is 0

See also

WorkflowDataTools, ProbeWorkflowRequest