[#BloombergLP-bslalg-NumericFormatterUtil-ToCharsMaxLength]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::xref:BloombergLP/bslalg/NumericFormatterUtil.adoc[NumericFormatterUtil]::ToCharsMaxLength
:relfileprefix: ../../../
:mrdocs:

Minimum buffer size for `toChars` conversion of `TYPE`&period;

== Synopsis

Declared in `&lt;bslalg&lowbar;numericformatterutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class TYPE,
    int ARG = k&lowbar;MAXLEN&lowbar;ARG&lowbar;DEFAULT&gt;
struct ToCharsMaxLength;
----

== Description

This `struct` template implements the meta&hyphen;function to determine the minimum sufficient size of a buffer to successfully convert any numeric value of a specified `TYPE` supported by one of the `toChars` function overloads in `NumericFormatterUtil`&period; The meta&hyphen;function allows specifying an argument value to the `toChars` overloads, as a non&hyphen;type template parameter&period; That value stands for the `base` parameter for integral conversions, and the `format` parameter for floating point conversions&period; A second non&hyphen;type template parameter is reserved for further addition in case the `precision` parameter overloads are implemented for floating point conversions (in addition to the `format` parameter)&period; The compile&hyphen;time &quot;return value&quot; of `ToCharsMaxLength` is an enumerator name `k&lowbar;VALUE`&period; For usage examples see &lcub;Example 3&colon; Determining The Required Buffer Size&rcub;&period;

== Enums

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslalg/NumericFormatterUtil/ToCharsMaxLength/ValueType.adoc[`ValueType`] 
| Maximum buffer length required for the selected type and argument&period;
|===



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