[#BloombergLP-bdldfp-DecimalConvertUtil-decimalToNetwork-09]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdldfp.adoc[bdldfp]::xref:BloombergLP/bdldfp/DecimalConvertUtil.adoc[DecimalConvertUtil]::decimalToNetwork
:relfileprefix: ../../../
:mrdocs:

Store `decimal` in network format into `buffer`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
unsigned char*
decimalToNetwork(
    unsigned char* buffer,
    xref:BloombergLP/bdldfp/Decimal32.adoc[Decimal32] decimal);
----

== Description

The network format is defined as big endian byte order and densely packed base&hyphen;10 significand encoding&period; This corresponds to the way IBM hardware represents these numbers in memory&period; The behavior is undefined unless `buffer` points to a memory area at least `sizeof(decimal)` in size&period; Note that these functions always return `buffer &plus; sizeof(decimal)` on the supported 8&hyphen;bits&hyphen;byte architectures&period;

== Return Value

address one past the last byte written

== Parameters

[cols="1,4"]
|===
| Name| Description
| *buffer*
| receives the network encoding
| *decimal*
| value to encode
|===


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