contents.gifindex.gifprev1.gifnext1.gif

CLng

Purpose

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

Arguments

CLng( expression )

Notes

This function explicitly controls the data type of a numeric expression. This function forces integer arithmetic in cases in which currency, single-precision, or double-precision arithmetic normally would occur. Because CLng converts expressions to integers, you can use this function to round fractional numbers.

Example

CLng converts each Single value to a Long. Note that 25427.45 is rounded down to 25427, whereas 25427.55 is rounded up to 25428.

X = CLng( 25427.45 )