2.2.1.1.1.1 DECIMAL

DECIMAL is used to represent an exact numeric value with a fixed precision and fixed scale.

When vType is set to VT_DECIMAL (0x0000E), the vData1 and vData2 fields of CBaseStorageVariant MUST be interpreted as follows:

vData1: The number of digits to the right of the decimal point. MUST be in the range 0 to 28.

vData2: The sign of the numeric value. Set to 0x00 if positive; set to 0x80 if negative.

When vType is set to VT_DECIMAL, the format of the vValue field is specified in the following diagram.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

wReserved

scale

sign

Hi32

Lo64

wReserved (2 bytes): MUST be set to zero and MUST be ignored.

scale (1 byte): The number of decimal places for the number. Valid values are from 0 to 28.

sign (1 byte): Indicates the sign; 0 for positive numbers or DECIMAL_NEG(0x80) for negative numbers.

Hi32 (4 bytes): The high 32 bits of the number.

Lo64 (8 bytes): The low 64 bits of the number.