BloombergLP::bdldfp::DecimalConvertUtil::decimal64ToMultiWidthEncoding

Encode decimal in multi-width format into buffer.

Synopsis

Declared in <bdldfp_decimalconvertutil.h>

static
bsls::Types::size_type
decimal64ToMultiWidthEncoding(
    unsigned char* buffer,
    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 8 bytes).

Return Value

number of bytes used by the encoding

Parameters

NameDescription
bufferreceives the multi-width encoding
decimalvalue to encode