NUMERIC

The NUMERIC typedef structure is an exact numeric value with a fixed precision and fixed scale. The NUMERIC typedef structure is defined as follows:

typedef struct tagNUMERIC {
    BYTE precision;
    BYTE scale;
    BYTE sign;
    BYTE val[16];
} DB_NUMERIC;

Members

Precision
The maximum number of digits in base 10.
Scale
The number of digits to the right of the decimal point.
Sign
The sign is 1 for positive numbers, and 0 for negative numbers.
Val
A number stored as a 16-byte scaled integer, with the least-significant byte on the left.

For example, to specify the base 10 number 20.003 with a scale of 4, the number is scaled to an integer of 200030 (20.003 shifted by four tens digits), which is 186AA in hexadecimal. The value stored in the 16-byte integer is 5E 0D 03 00 00 00 00 00 00 00 00 00 00 00 00 00, the precision is the maximum precision, the scale is 4, and the sign is 1.