Here are 3 examples of using the Clng() function in VB.NET:
1. Convert a string to a Long:
Dim strNumber As String = "12345"
Dim lng As Long = CLng(strNumber)
2. Convert a double to a Long by rounding:
Dim dbl As Double = 12.34
Dim lng As Long = CLng(dbl)
3. Convert an integer to a Long:
Dim int As Integer = 10000
Dim lng As Long = CLng(int)
The Clng() function converts its argument to a Long data type. Any fractional portions are truncated. It can convert from strings, doubles, integers, or other