2.2.1.3 Fixed-Length Types
The following specifies groupable data types of fixed length:
-
FIXED-LEN-VTDATA-GROUPABLE = ( VT-EMPTY ) / ( VT-NULL ) / ( VT-I2 WORD ) / ( VT-I4 LONG ) / ( VT-R4 FLOAT ) / ( VT-R8 DOUBLE ) / ( VT-CY CY ) / ( VT-DATE DATEVAL ) / ( VT-BOOL BOOLVAL ) / ( VT-UI1 BYTE ) / ( VT-DECIMAL DECIMAL )
VT-CY: Currency is a fixed-point number with four digits to the right of the decimal point. It is stored in an 8-byte signed integer, scaled by 10,000. The syntax of CY is as follows:
CY = CYLOW CYHI CYLOW = LONG CYHI = ULONG
VT-BOOL: A two-byte value that corresponds and encodes two states of true and false. By convention %x00.00, it corresponds to a value of "true". The related definition is as follows:
BOOLVAL = %xFF.FF / %x00.00
VT-DATE: DATEVAL is a Double, the whole part of which is the number of days since December 30, 1899, and the fractional part is the fraction of a day. For example, the number 2.25 represents the date and time January 1, 1900, at 6:00AM.
DATEVAL = DOUBLE
DECIMAL:
datatype identifier: VT-DECIMAL
A DECIMAL specifies a decimal value, a number in decimal exponential notation with a fixed precision of 12 bytes. The decimal value is specified according to the following rules:
The decimal value's sign MUST be negative if the value of the DECIMALSign field is DECIMALNegative, and positive or zero otherwise.
The decimal value's absolute value is specified by the following formula, in which v is the decimal value, s is the value of DECIMALScale, and m is the value of the mantissa: |v| = 10^(-s)*m
The syntax of DECIMAL is as follows:
DECIMAL = 2ZEROBYTE DECIMALScale DECIMALSign DECIMALMantissa
DECIMALScale: The exponent of the decimal ranges from 0 to 28.
DECIMALScale = BYTE
DECIMALSign: Specifies the sign of the decimal value.
DECIMALSign = DECIMALPositive / DECIMALNegative DECIMALPositive = %x00 DECIMALNegative = %x80
DECIMALMantissa: A 12-byte, unsigned integer that specifies the mantissa of the decimal value. The range of the mantissa is 0-2^96.
DECIMALMantissa = DECIMALHigh DECIMALLow DECIMALMid
DECIMALHigh: The most significant 4 bytes of the mantissa.
DECIMALHigh = ULONG
DECIMALLow: The least significant 4 bytes of the mantissa.
DECIMALLow = ULONG
DECIMALMid: The middle 4 bytes of the mantissa.
DECIMALMid = ULONG