Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

DECIMAL Data Type [Automation]

A decimal data type that provides a sign and scale for a number (as in coordinates). Decimal variables are stored as 96-bit (12-byte) unsigned integers scaled by a variable power of 10. The power of 10 scaling factor specifies the number of digits to the right of the decimal point, and ranges from 0 to 28.

See also Numeric Parsing Functions and Conversion and Manipulation Functions.

typedef struct tagDEC {
    USHORT wReserved;
    union {
        struct {
            char scale;   // The number of decimal places for the
// number. Valid values are from 0 to 28. So
// 12.345 is represented as 12345 with a 
// scale of 3.
            Char sign;   // 0 for positive numbers or DECIMAL_NEG for 
// negative numbers. So -1 is represented as 
// 1 with the DECIMAL_NEG bit set.
        USHORT signscale;
    ULONG Hi32;            // The high 32 bits of your number
    union {
        struct {
#ifdef _MAC
            ULONG Mid32;
            ULONG Lo32;
            ULONG Lo32;
            ULONG Mid32;
        DWORDLONG Lo64;   // The low 64 bits of your number. This is an 
                           // _int64.
© 2015 Microsoft