CLNGLNG

CLNGLNG(expression)

Returns the expression converted to a longlong (64 bit platform) data type.


expressionThe expression to evaluate and convert to a longlong.

REMARKS
* Takes a Variant.
* Valid on 64 bit platforms.
* Fractions are rounded.
* You can use the CLNG function to return an expression converted to a Long data type.
* You can use the CLNGPTR function to return a LongPtr data type.
* For a full list of conversion functions refer to the Explicit Conversion page.

Debug.Print CLngLng(0.5)       '= 0  
Debug.Print CLngLng(0.6) '= 1
Debug.Print CLngLng(1.5) '= 2
Debug.Print CLngLng(2.5) '= 2
Debug.Print CLngLng(2.6) '= 3
Debug.Print CLngLng(2.9) '= 3
Debug.Print CLngLng(3.5) '= 4
Debug.Print CLngLng("1234567") '= 1234567

Dim llNumber As LongLong
Dim iValue As Integer
iValue = 30.75
llNumber = CLngLng(iValue)
Debug.Print llNumber
Debug.Print TypeName(llNumber) '= "LongLong"

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