[#BloombergLP-baljsn-JsonFormatter-putValue] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/baljsn.adoc[baljsn]::xref:BloombergLP/baljsn/JsonFormatter.adoc[JsonFormatter]::putValue :relfileprefix: ../../../ :mrdocs: 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`. == 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); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#