[#BloombergLP-bdldfp-DecimalUtil-format-0d]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdldfp.adoc[bdldfp]::xref:BloombergLP/bdldfp/DecimalUtil.adoc[DecimalUtil]::format
:relfileprefix: ../../../
:mrdocs:

`format` overloads

== Synopses

Declared in `&lt;bdldfp&lowbar;decimalutil&period;h&gt;`

Same as the related overload above for `format`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
xref:BloombergLP/bdldfp/DecimalUtil/format-05.adoc[format](
    char* buffer,
    int length,
    xref:BloombergLP/bdldfp/Decimal128.adoc[Decimal128] value,
    xref:BloombergLP/bdldfp/DecimalFormatConfig.adoc[DecimalFormatConfig] const& cfg = DecimalFormatConfig());
----

[.small]#xref:BloombergLP/bdldfp/DecimalUtil/format-05.adoc[_» more&period;&period;&period;_]#

Format the specified `value`, placing the output in the buffer designated by the specified `buffer` and `length`, and return the length of the formatted value&period; If there is insufficient room in the buffer, its contents will be left in an unspecified state, with the returned value indicating the necessary size&period; This function does not write a terminating null character&period; If `length` is not positive, `buffer` is permitted to be null&period; This can be used to determine the necessary buffer size&period; Optionally specify a `cfg`, indicating formatting parameters&period; If `cfg` is not specified, then default configuration instance, indicating scientific notation style with a precision sufficient to produce all available digits is used&period; See the  section for information on the configuration attributes&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
xref:BloombergLP/bdldfp/DecimalUtil/format-00.adoc[format](
    char* buffer,
    int length,
    xref:BloombergLP/bdldfp/Decimal32.adoc[Decimal32] value,
    xref:BloombergLP/bdldfp/DecimalFormatConfig.adoc[DecimalFormatConfig] const& cfg = DecimalFormatConfig());
----

[.small]#xref:BloombergLP/bdldfp/DecimalUtil/format-00.adoc[_» more&period;&period;&period;_]#

Same as the overload taking `Decimal32`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
xref:BloombergLP/bdldfp/DecimalUtil/format-0b.adoc[format](
    char* buffer,
    int length,
    xref:BloombergLP/bdldfp/Decimal64.adoc[Decimal64] value,
    xref:BloombergLP/bdldfp/DecimalFormatConfig.adoc[DecimalFormatConfig] const& cfg = DecimalFormatConfig());
----

[.small]#xref:BloombergLP/bdldfp/DecimalUtil/format-0b.adoc[_» more&period;&period;&period;_]#


[.small]#Created with https://www.mrdocs.com[MrDocs]#
