This is an abbreviation for Double Precision Floating Point.
This can support 15 significant figures with 14 decimal places.
This data type uses 8 bytes
The default value is 0.

Dim myDouble As Double 

Possible Numbers

The Double data type can contain any number in the following ranges:
This data type contains a double precision floating point number
Negative numbers: -1.79769313486232 E308 to -4.94065645841247 E-324
Positive numbers: 4.94065645841247 E-324 to +1.79769313486232 E308
If you need greater precision (with less or no rounding errors) then you should use the Decimal data type (this supports 29 significant figures).

Adding Two Numbers

Declare two variables with the value (562,949,953,421,312) and add them together.

Dim myDouble1 As Double 
Dim myDouble2 As Double
Dim myResult As Double

myDouble1 = 562949953421312
myDouble2 = 562949953421312
myResult = myDouble1 + myDouble2

Debug.Print myResult ' = 1.12589990684262E+15

Conversion Function

The CDBL function returns an expression converted to a Currency data type.

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