[#BloombergLP-baljsn-JsonFormatter-putValue] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/baljsn.adoc[baljsn]::xref:BloombergLP/baljsn/JsonFormatter.adoc[JsonFormatter]::putValue :relfileprefix: ../../../ :mrdocs: Set the current scalar, array element, or object member to `value`. == Synopsis Declared in `<baljsn_jsonformatter.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> int putValue( TYPE const& value, xref:BloombergLP/baljsn/EncoderOptions.adoc[EncoderOptions] const* options = 0); ---- == Description Set the value of the current scalar, array element, or object value ‐‐ depending on the context ‐‐ to the specified `value` of (template parameter) `TYPE`. The specified `options` is ignored except: * `encodeInfAndNaNAsStrings` when `TYPE` is a floating point type. * `datetimeFractionalSecondPrecision` when `TYPE` features a datetime or time attribute. Return 0 on success and a non‐zero value otherwise. Errors are returned if `value` is disallowed for `bdljsn::Json` objects: * `value` is a string type and contains a non‐UTF8 character. * `value` is a floating point type, is INF or NaN, and `false == encodeInfAndNanAsStrings`. == Return Value 0 on success and a non‐zero value otherwise == Parameters [cols="1,4"] |=== | Name| Description | *value* | value to encode as JSON | *options* | optional encoding options; null uses defaults |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#