contents.gifindex.gifprev1.gifnext1.gif

CSng

Purpose

Explicitly converts an expression from one data type to the single data type.

Arguments

CSng( expression )

Notes

This function controls the data type of a numeric expression explicitly. This function forces single-precision arithmetic in cases in which currency or integer arithmetic normally would occur.

Example

CSng converts each Double value to a Single. Note that 75.3421115 is rounded down to 75.34211, whereas 75.3421155 is rounded up to 75.34212.

X = CSng( 75.3421115 )