BloombergLP::baljsn::JsonFormatter_Util::setFloatingPointToJson

Load the JSON representation of a floating-point value into json.

Synopsis

Declared in <baljsn_jsonformatter.h>

template<class TYPE>
static
int
setFloatingPointToJson(
    bdljsn::Json* json,
    TYPE const& value,
    EncoderOptions const* options);

Description

Optionally use the specified options (notably encodeInfAndNaNAsStrings). Return 0 on success and a non-zero value otherwise.

Return Value

0 on success and a non-zero value otherwise

Parameters

NameDescription
jsonJSON object to receive the encoded value
valuefloating-point value to encode
optionsoptional encoding options; null uses defaults