[#BloombergLP-bdldfp-DecimalConvertUtil-decimalToDPD-01]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdldfp.adoc[bdldfp]::xref:BloombergLP/bdldfp/DecimalConvertUtil.adoc[DecimalConvertUtil]::decimalToDPD
:relfileprefix: ../../../
:mrdocs:

Populate `buffer` with the DPD representation of `decimal`&period;

== Synopsis

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

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

== Description

The DPD representations of `Decimal32`, `Decimal64`, and `Decimal128` require 4, 8, and 16 bytes respectively&period; The behavior is undefined unless `buffer` points to a contiguous sequence of at least `sizeof(decimal)` bytes&period; Note that the DPD representation is defined in section 3&period;5 of IEEE 754&hyphen;2008&period;

== Parameters

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


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