Name
CLng Function
Synopsis
CLng(expression
)
expression
required; Numeric or StringA number or a string representation of a number
Named Arguments
No
Return Value
expression
cast as a Long data type
Description
Converts expression
to a long integer; any
fractional element of expression
is
rounded. When the fractional part is exactly .5,
CLng always rounds it to the nearest even
number. If expression
is not numeric or is
outside the range of the Long data type, an exception is generated.
Use IsNumeric to test whether
expression
evaluates to a number.
Get VB.NET Language Pocket Reference now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.