CitectVBA Programming Reference > CitectVBA Function Reference > Conversion Functions > CSng

CSng

Converts expressions to a single data type.

Syntax

CSng(Exp)

Exp:

A valid string, number or Variant containing a value recognizable as a string or number.

Return Value

Returns the value of the expression Exp provided in the argument as a single data type.

Related Functions

CDate | CDbl | CInt | CLng | CStr | CVar

Example

Dim x as integer
Dim s as single
s = CSng(x) 'Converts the integer value of x to a single value in s