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

Encode `decimal` in variable&hyphen;width format into `buffer`&period;

== Synopsis

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

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

== Description

The behavior is undefined unless `buffer` points to a memory area with enough room to hold the encoded value (which has a maximum size of 9 bytes)&period;

== Return Value

address one past the last byte written

== Parameters

[cols="1,4"]
|===
| Name| Description
| *buffer*
| receives the variable&hyphen;width encoding
| *decimal*
| value to encode
|===


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