{{fbdoc item="title" value="CLNG"}}----
Converts numeric or string expression to ##[[KeyPgLong Long]]##

{{fbdoc item="syntax"}}##
	[[KeyPgDeclare declare]] [[KeyPgFunction function]] **Clng** ( [[KeyPgByval byval]] //expression// [[KeyPgAs as]] [[DataType datatype]] ) [[KeyPgAs as]] [[KeyPgLong long]]

	[[KeyPgType Type]] //typename//
		[[KeyPgDeclare declare]] [[KeyPgOperator operator]] [[KeyPgCast cast]] ( ) [[KeyPgAs as]] [[KeyPgLong long]]
	End Type
##
{{fbdoc item="usage"}}##
	//result// = **Clng**( //numeric expression// )
	//result// = **Clng**( //string expression// )
	//result// = **Clng**( //user defined type// )
##
{{fbdoc item="param"}}
	##//expression//##
		a numeric, string, or pointer expression to cast to a ##[[KeyPgLong Long]]## value
	##//datatype//##
		any numeric, string, or pointer data type
	##//typename//##
		a user defined type

{{fbdoc item="ret"}}
	A ##[[KeyPgLong Long]]## value.

{{fbdoc item="desc"}}
	The ##**Clng**## function rounds off the decimal part and returns a 32-bit ##[[KeyPgLong Long]]## value.  The function does not check for an overflow, and results are undefined for values which are less than ##-2## ##147## ##483## ##648## or larger than ##2## ##147## ##483## ##648##.

	The name can be explained as 'Convert to ""LoNG""'.

	If the argument is a string expression, it is converted to numeric by using ##[[KeyPgValint Valint]]##.

{{fbdoc item="ex"}}

{{fbdoc item="filename" value="examples/manual/casting/clng.bas"}}%%(freebasic)
' Using the CLNG function to convert a numeric value

'Create an LONG variable
DIM numeric_value AS LONG

'Convert a numeric value
numeric_value = CLNG(-300.23)

'Print the result, should return -300
PRINT numeric_value
SLEEP
%%

{{fbdoc item="diff"}}
	- The string argument was not allowed in QB

{{fbdoc item="see"}}
	- ##[[KeyPgCbyte Cbyte]]##
	- ##[[KeyPgCubyte Cubyte]]##
	- ##[[KeyPgCshort Cshort]]##
	- ##[[KeyPgCushort Cushort]]##
	- ##[[KeyPgCint Cint]]##
	- ##[[KeyPgCuint Cuint]]##
	- ##[[KeyPgCulng Culng]]##
	- ##[[KeyPgClngint Clngint]]##
	- ##[[KeyPgCulngint Culngint]]##
	- ##[[KeyPgCsng Csng]]##
	- ##[[KeyPgCdbl Cdbl]]##

{{fbdoc item="back" value="CatPgCasting|Converting Data Types"}}