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

This `struct` provides a namespace for utility functions that convert between the decimal floating&hyphen;point types of `bdldfp&lowbar;decimal` and various other formats&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct DecimalConvertUtil;
----

== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal128FromBID-04.adoc[`decimal128FromBID`] 
| `decimal128FromBID` overloads
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal128FromDPD-0f.adoc[`decimal128FromDPD`] 
| `decimal128FromDPD` overloads
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal128FromDouble.adoc[`decimal128FromDouble`] 
| Return a `Decimal128` converted from the specified `binary`&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal128FromFloat.adoc[`decimal128FromFloat`] 
| Return a decimal floating&hyphen;point number converted from `binary`&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal128FromNetwork.adoc[`decimal128FromNetwork`] 
| Store into `decimal` the value decoded from network format at `buffer`&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal128ToBID.adoc[`decimal128ToBID`] 
| DEPRECATED&colon; Use `decimalToBID` instead&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal128ToDPD.adoc[`decimal128ToDPD`] 
| DEPRECATED&colon; Use `decimalToDPD` instead&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal128ToDouble.adoc[`decimal128ToDouble`] 
| DEPRECATED&colon; Use `decimalToDouble` instead&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal128ToFloat.adoc[`decimal128ToFloat`] 
| DEPRECATED&colon; Use `decimalToFloat` instead&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal128ToNetwork.adoc[`decimal128ToNetwork`] 
| Store `decimal` in network format into `buffer`&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal32FromBID-0f.adoc[`decimal32FromBID`] 
| `decimal32FromBID` overloads
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal32FromDPD-03.adoc[`decimal32FromDPD`] 
| `decimal32FromDPD` overloads
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal32FromDouble.adoc[`decimal32FromDouble`] 
| Return a `Decimal32` converted from the specified `binary`&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal32FromFloat.adoc[`decimal32FromFloat`] 
| DEPRECATED&colon; Use `decimalFromFloat` instead&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal32FromNetwork.adoc[`decimal32FromNetwork`] 
| Store into `decimal` the value decoded from network format at `buffer`&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal32ToBID.adoc[`decimal32ToBID`] 
| Encode the specified `decimal` into `buffer` in BID format&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal32ToDPD.adoc[`decimal32ToDPD`] 
| Encode the specified `decimal` into `buffer` in DPD format&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal32ToDouble.adoc[`decimal32ToDouble`] 
| Return the `double` closest to the specified `decimal`&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal32ToFloat.adoc[`decimal32ToFloat`] 
| Return the `float` closest to the specified `decimal`&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal32ToNetwork.adoc[`decimal32ToNetwork`] 
| Store `decimal` in network format into `buffer`&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal64FromBID-03.adoc[`decimal64FromBID`] 
| `decimal64FromBID` overloads
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal64FromDPD-0e.adoc[`decimal64FromDPD`] 
| `decimal64FromDPD` overloads
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal64FromDouble.adoc[`decimal64FromDouble`] 
| Return a `Decimal64` converted from the specified `binary`&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal64FromFloat.adoc[`decimal64FromFloat`] 
| DEPRECATED&colon; Use `decimalFromFloat` instead&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal64FromMultiWidthEncoding.adoc[`decimal64FromMultiWidthEncoding`] 
| Decode a multi&hyphen;width encoded `Decimal64` from `buffer`&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal64FromMultiWidthEncodingIfValid.adoc[`decimal64FromMultiWidthEncodingIfValid`] 
| Decode a multi&hyphen;width value from `buffer` if `size` is valid&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal64FromMultiWidthEncodingRaw.adoc[`decimal64FromMultiWidthEncodingRaw`] 
| Decode a multi&hyphen;width value of at most 5 bytes from `buffer`&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal64FromNetwork.adoc[`decimal64FromNetwork`] 
| Store into `decimal` the value decoded from network format at `buffer`&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal64FromVariableWidthEncoding.adoc[`decimal64FromVariableWidthEncoding`] 
| Decode a variable&hyphen;width `Decimal64` from `buffer` into `decimal`&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal64ToBID.adoc[`decimal64ToBID`] 
| DEPRECATED&colon; Use `decimalToBID` instead&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal64ToDPD.adoc[`decimal64ToDPD`] 
| DEPRECATED&colon; Use `decimalToDPD` instead&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal64ToDouble.adoc[`decimal64ToDouble`] 
| Return the `double` closest to the specified `decimal`&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal64ToFloat.adoc[`decimal64ToFloat`] 
| DEPRECATED&colon; Use `decimalToFloat` instead&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal64ToMultiWidthEncoding.adoc[`decimal64ToMultiWidthEncoding`] 
| Encode `decimal` in multi&hyphen;width format into `buffer`&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal64ToMultiWidthEncodingRaw.adoc[`decimal64ToMultiWidthEncodingRaw`] 
| Encode `decimal` into `buffer` if it fits in 5 or fewer bytes&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal64ToNetwork.adoc[`decimal64ToNetwork`] 
| Store `decimal` in network format into `buffer`&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimal64ToVariableWidthEncoding.adoc[`decimal64ToVariableWidthEncoding`] 
| Encode `decimal` in variable&hyphen;width format into `buffer`&period;
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimalFromBID-0c5.adoc[`decimalFromBID`] 
| `decimalFromBID` overloads
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimalFromDPD-088.adoc[`decimalFromDPD`] 
| `decimalFromDPD` overloads
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimalFromNetwork-0e.adoc[`decimalFromNetwork`] 
| `decimalFromNetwork` overloads
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimalToBID-00.adoc[`decimalToBID`] 
| `decimalToBID` overloads
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimalToDPD-04.adoc[`decimalToDPD`] 
| `decimalToDPD` overloads
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimalToDouble-0f.adoc[`decimalToDouble`] 
| `decimalToDouble` overloads
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimalToFloat-029.adoc[`decimalToFloat`] 
| `decimalToFloat` overloads
| xref:BloombergLP/bdldfp/DecimalConvertUtil/decimalToNetwork-0d.adoc[`decimalToNetwork`] 
| `decimalToNetwork` overloads
| xref:BloombergLP/bdldfp/DecimalConvertUtil/isValidMultiWidthSize.adoc[`isValidMultiWidthSize`] 
| Return whether `size` is valid for multi&hyphen;width encoding&period;
|===



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