CDBL(expression)

Returns the expression converted to a double data type (Double).


expressionThe expression to evaluate and convert to a double.

REMARKS
* The Double data type is a Value data type.
* The "expression" can be any number between (-4.94 E-324) and (1.79 E308).
* If "expression" is outside this range, then an error occurs.
* This function uses the locale setting to identify the different decimal separators and thousand separators.
* You can use the CINT function to return an expression converted to an integer data type.
* You can use the CLNG function to return an expression converted to a long data type.
* You can use the CSNG function to return an expression converted to a single data type.
* For the Microsoft documentation refer to docs.microsoft.com

Debug.Print CDbl(30)  '30  
Debug.Print CDbl("0.00") '0
Debug.Print CDbl(#01/07/77#) '28132
Debug.Print CDbl("-100") '-100
Debug.Print CDbl("100-") '-100

Dim dbNumber As Double
Dim iNumber As Integer
iNumber = 20
dbNumber = CDbl(iNumber)


© 2019 Better Solutions Limited. All Rights Reserved. © 2019 Better Solutions Limited Top