[#BloombergLP-bslfmt-format_to_n-07]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslfmt.adoc[bslfmt]::format&lowbar;to&lowbar;n
:relfileprefix: ../../
:mrdocs:

Format `args` per `fmtStr` into `out`, writing at most `maxNumChars`&period;

== Synopses

Declared in `&lt;bslfmt&lowbar;format&lowbar;imp&period;h&gt;`

Format `args` per `fmtStr` into `out`, writing at most `maxNumChars`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;OUT,
    class&period;&period;&period; t&lowbar;ARGS&gt;
format&lowbar;to&lowbar;n&lowbar;result&lt;t&lowbar;OUT&gt;
xref:BloombergLP/bslfmt/format_to_n-0b.adoc[format&lowbar;to&lowbar;n](
    t&lowbar;OUT out,
    bsl::iterator&lowbar;traits&lt;t&lowbar;OUT&gt;::difference&lowbar;type maxNumChars,
    xref:BloombergLP/bslfmt/format_string.adoc[bslfmt::format&lowbar;string&lt;t&lowbar;ARGS&period;&period;&period;&gt;] fmtStr,
    t&lowbar;ARGS const&&period;&period;&period; args);
----

[.small]#xref:BloombergLP/bslfmt/format_to_n-0b.adoc[_» more&period;&period;&period;_]#

Format `args` per `fmtStr` into `out`, writing at most `maxNumChars`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;OUT,
    class&period;&period;&period; t&lowbar;ARGS&gt;
format&lowbar;to&lowbar;n&lowbar;result&lt;t&lowbar;OUT&gt;
xref:BloombergLP/bslfmt/format_to_n-0a.adoc[format&lowbar;to&lowbar;n](
    t&lowbar;OUT out,
    bsl::iterator&lowbar;traits&lt;t&lowbar;OUT&gt;::difference&lowbar;type maxNumChars,
    xref:BloombergLP/bslfmt/wformat_string.adoc[bslfmt::wformat&lowbar;string&lt;t&lowbar;ARGS&period;&period;&period;&gt;] fmtStr,
    t&lowbar;ARGS const&&period;&period;&period; args);
----

[.small]#xref:BloombergLP/bslfmt/format_to_n-0a.adoc[_» more&period;&period;&period;_]#

== Return Value

a `format&lowbar;to&lowbar;n&lowbar;result` with the output iterator and untruncated size

== Parameters

[cols="1,4"]
|===
| Name| Description
| *out*
| output iterator receiving formatted characters
| *maxNumChars*
| maximum number of characters to write
| *fmtStr*
| format string
| *args*
| values to format
|===


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