Number Data Types


Integer

KeywordSystem.SuffixVB.NetComments
sbyteSystem.SByte  (8 bits) -128 to 127
byteSystem.Byte Byte(8 bits) Unsigned Integer 0 to 255
shortSystem.Int16 Short(16 bits) -32,768 to 32,767
Integer in VBA
ushortSystem.UInt16  (16 bits) Unsigned Integer 0 to 65,535
intSystem.Int32 Integer(32 bits) -2,147,483,648 to 2,147,483,647
uintSystem.UInt32u or U (32 bits) Unsigned Integer 0 to 4,294,967,295
longSystem.Int64l or LLong(64 bits) -9.2 E 18 to 9.2 E 18
ulongSystem.UInt64ul or UL (64 bits) Unsigned Integer 0 to 1.84 E 19

Floating Point

KeywordSystem.SuffixVB.NetComments
floatSystem.Singlef or FSingle(32 bits, 4 bytes) Single Precision Floating Point
-3.402 E 38 to 3.4.02 E 38, precision ~6-9 digits
doubleSystem.Doubled or D
(R in VB.Net)
Double(64 bits, 8 bytes) Double Precision Floating Point
-1.797 E 308 to 1.797 E 308, precision ~15-17 digits
decimalSystem.Decimalm or M
(D in VB.Net)
Decimal(128 bits, 16 bytes) Precise Integer and Fractional type
Can represent decimal numbers with 29 significant digits
1 E -28 to 7.9 E 28
Currency in VBA

© 2023 Better Solutions Limited. All Rights Reserved. © 2023 Better Solutions Limited TopPrevNext