BloombergLP::baljsn::PrintUtil::printFloatingPoint

Encode a floating-point value as JSON onto stream.

Synopsis

Declared in <baljsn_printutil.h>

template<class TYPE>
static
int
printFloatingPoint(
    std::ostream& stream,
    TYPE value,
    EncoderOptions const* options);

Description

Encode the specified floating point value into JSON and output the result to the specified stream. Use the optionally-specified options to decide how value is encoded.

Return Value

0 on success, and a non-zero value otherwise

Parameters

NameDescription
streamoutput stream for JSON
valuefloating-point value to encode
optionsencoding options; null uses defaults