VBA Internals: Decimal Variables and Pointers In Depth

July 17, 2013 in VBA

Decimal Variants The Decimal type is special. It’s a structure that takes 14 bytes. Essentially it’s a 96-bit (12-byte) signed integer, plus a 1-byte scaling factor and a 1-byte sign. The scaling works just like the Scale attribute of a SQL Decimal, indicating the number of significant base-10 digits that appear after the decimal. Although the scale is a whole byte, valid values are only 0 to 28. Likewise the only valid values for the sign byte are 0 (positive) or 1 (negative). Note that all other non-Variant built-in types in VBA take 8 or fewer bytes; they all fit
…read more