Home / lang / csng 
CSng
Syntax
Result = CSng ( Expression AS Variant ) AS Single
Result = CSingle ( Expression AS Variant ) AS Single

Converts an expression into a Single floating point number.

Be careful! The current localization is not used by this function.

Errors
MessageDescription
Type mismatch (#6) Expression cannot be converted.

Example
PRINT CSng("+3.1416")

3.1416
Example
PRINT CSng("1.0E+3")

1000
Example
PRINT CSng(Pi);; CFloat(Pi)

3.141592741013 3.14159265359
Example
PRINT CSng(1E50)

Overflow


See also
Conversion Functions