DECIMAL

The DECIMAL typedef structure is an exact numeric value with a fixed precision and fixed scale, stored in the same way as in OLE Automation. The DECIMAL typedef structure is defined as follows:

typedef struct tagDECIMAL {
    USHORT wReserved;
    union {
        struct {
            BYTE scale;
            BYTE sign;
         };
        USHORT signscale;
    };
    ULONG Hi32;
    union {
        struct {
             ULONG Lo32;
             ULONG Mid32;
          };
         ULONGLONG Lo64;
    };
} DECIMAL;

Members

wReserved
This member is reserved and should be 0.
Scale
Specifies the number of digits to the right of the decimal point and ranges from 0 to 28.
Sign
The sign is 0 if positive, 0x80 if negative.
Hi32
The high part of the integer (32-bit aligned).
Mid32
The middle part of the integer (32-bit aligned).
Lo32
The low part of the integer (32-bit aligned).

For example, to specify the number 12.345, the scale is 3, the sign is 0, and the number stored in the 12-byte integer is 12345.