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

`toChars` overloads

== Synopses

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

Write the specified floating point `value` into the character buffer starting a the specified `first` and ending at the specified `last`, `last` not included&period; Use the &lcub;Default Floating Point Format&rcub;&period; Return the address one past the last character (lowest order digit or last digit of the exponent) written on success, or `0` on failure&period; The only reason for failure is when the range `&lsqb; first, last )&rsqb;` is not large enough to contain the result&period; The written result is to begin at `first` with leftover room following the return value&period; The behavior is undefined unless `first &lt;&equals; last`&period; Note that these functions do *not* null&hyphen;terminate the result&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
char*
xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-0c.adoc[toChars](
    char* first,
    char* last,
    double value) noexcept;
----

[.small]#xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-0c.adoc[_» more&period;&period;&period;_]#

Same as the preceding `toChars` overload, for `float` values&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
char*
xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-05b.adoc[toChars](
    char* first,
    char* last,
    float value) noexcept;
----

[.small]#xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-05b.adoc[_» more&period;&period;&period;_]#

included&period; If the optionally specified `base`argument is not present base 10 is used&period; Return the address one past the last character (lowest order digit or last digit of the exponent) written on success, or `0` on failure&period; The only reason for failure is when the range `&lsqb; first, last )&rsqb;` is not large enough to contain the result&period; The written result is to begin at `first` with leftover room following the return value&period; The behavior is undefined unless `first &lt;&equals; last`, and `base` is in the range `&lsqb; 2 &period;&period; 36 &rsqb;`&period; Note that the type `bool` for the `value` parameter is explicitly disabled in the &quot;NOT IMPLEMENTED&quot; `private` section, because `bool` would otherwise be promoted to `int` and printed as `0` or `1`, instead of the (possibly) expected `false` and `true`&semi; and `bool` is not an integral or numeric type either&period; Also note that these functions do *not* null&hyphen;terminate the result&period; Format the specified character `value` into `&lsqb;first, last)&rsqb;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
char*
xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-007.adoc[toChars](
    char* first,
    char* last,
    char value,
    int base = 10) noexcept;
----

[.small]#xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-007.adoc[_» more&period;&period;&period;_]#

Write the specified floating point `value` into the character buffer starting a the specified `first` and ending at the specified `last`, `last` not included, using the specified `format` with the &lcub;Shortest (Textual) Decimal Representation for Binary Floating Point Values&rcub; used in that format (that will produce the exact binary floating point `value` when converted back to the original type from text), but see possible exceptions under &lcub;Special Floating Point Values&rcub;&period; Return the address one past the last character (lowest order digit or last digit of the exponent) written on success, or `0` on failure&period; The only reason for failure is when the range `&lsqb; first, last )&rsqb;` is not large enough to contain the result&period; The written result is to begin at `first` with leftover room following the return value&period; The behavior is undefined unless `first &lt;&equals; last`&period; Note that these functions do *not* null&hyphen;terminate the result&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
char*
xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-01.adoc[toChars](
    char* first,
    char* last,
    double value,
    xref:BloombergLP/bslalg/NumericFormatterUtil/Format.adoc[Format] format) noexcept;
----

[.small]#xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-01.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, for `float` values&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
char*
xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-04.adoc[toChars](
    char* first,
    char* last,
    float value,
    xref:BloombergLP/bslalg/NumericFormatterUtil/Format.adoc[Format] format) noexcept;
----

[.small]#xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-04.adoc[_» more&period;&period;&period;_]#

Format the specified signed integer `value` into `&lsqb;first, last)&rsqb;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
char*
xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-03.adoc[toChars](
    char* first,
    char* last,
    int value,
    int base = 10) noexcept;
----

[.small]#xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-03.adoc[_» more&period;&period;&period;_]#

Format the specified signed long integer `value` into `&lsqb;first, last)&rsqb;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
char*
xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-005.adoc[toChars](
    char* first,
    char* last,
    long value,
    int base = 10) noexcept;
----

[.small]#xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-005.adoc[_» more&period;&period;&period;_]#

Format the specified signed long long integer `value` into `&lsqb;first, last)&rsqb;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
char*
xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-08.adoc[toChars](
    char* first,
    char* last,
    long long value,
    int base = 10) noexcept;
----

[.small]#xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-08.adoc[_» more&period;&period;&period;_]#

Format the specified signed short integer `value` into `&lsqb;first, last)&rsqb;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
char*
xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-0a1.adoc[toChars](
    char* first,
    char* last,
    short value,
    int base = 10) noexcept;
----

[.small]#xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-0a1.adoc[_» more&period;&period;&period;_]#

Format the specified signed character `value` into `&lsqb;first, last)&rsqb;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
char*
xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-0f.adoc[toChars](
    char* first,
    char* last,
    signed char value,
    int base = 10) noexcept;
----

[.small]#xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-0f.adoc[_» more&period;&period;&period;_]#

Format the specified unsigned character `value` into `&lsqb;first, last)&rsqb;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
char*
xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-0b.adoc[toChars](
    char* first,
    char* last,
    unsigned char value,
    int base = 10) noexcept;
----

[.small]#xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-0b.adoc[_» more&period;&period;&period;_]#

Format the specified unsigned integer `value` into `&lsqb;first, last)&rsqb;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
char*
xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-0d1.adoc[toChars](
    char* first,
    char* last,
    unsigned int value,
    int base = 10) noexcept;
----

[.small]#xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-0d1.adoc[_» more&period;&period;&period;_]#

Format the specified unsigned long integer `value` into `&lsqb;first, last)&rsqb;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
char*
xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-068.adoc[toChars](
    char* first,
    char* last,
    unsigned long value,
    int base = 10) noexcept;
----

[.small]#xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-068.adoc[_» more&period;&period;&period;_]#

Format the specified unsigned long long integer `value` into `&lsqb;first, last)&rsqb;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
char*
xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-058.adoc[toChars](
    char* first,
    char* last,
    unsigned long long value,
    int base = 10) noexcept;
----

[.small]#xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-058.adoc[_» more&period;&period;&period;_]#

Format the specified integer `value` into `&lsqb;first, last)&rsqb;` and return the end iterator&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
char*
xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-069.adoc[toChars](
    char* first,
    char* last,
    unsigned short value,
    int base = 10) noexcept;
----

[.small]#xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-069.adoc[_» more&period;&period;&period;_]#

Write the specified floating point `value` into the character buffer starting a the specified `first` and ending at the specified `last`, `last` not included, using the specified `format` and `precision`&period; Return the address one past the last character (lowest order digit or last digit of the exponent) written on success, or `0` on failure&period; The only reason for failure is when the range `&lsqb; first, last )&rsqb;` is not large enough to contain the result&period; The written result is to begin at `first` with leftover room following the return value&period; The behavior is undefined unless `first &lt;&equals; last`&period; Note that these functions do *not* null&hyphen;terminate the result&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
char*
xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-0d7.adoc[toChars](
    char* first,
    char* last,
    double value,
    xref:BloombergLP/bslalg/NumericFormatterUtil/Format.adoc[Format] format,
    int precision) noexcept;
----

[.small]#xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-0d7.adoc[_» more&period;&period;&period;_]#

Format the specified `float` `value` into `&lsqb;first, last)&rsqb;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
char*
xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-0aa.adoc[toChars](
    char* first,
    char* last,
    float value,
    xref:BloombergLP/bslalg/NumericFormatterUtil/Format.adoc[Format] format,
    int precision) noexcept;
----

[.small]#xref:BloombergLP/bslalg/NumericFormatterUtil/toChars-0aa.adoc[_» more&period;&period;&period;_]#


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