Click or drag to resize
ConvertToSingle Method (Double)
Converts the value of the specified double-precision floating-point number to an equivalent single-precision floating-point number.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public static float ToSingle(
	double value
)

Parameters

value
Type: SystemDouble
The double-precision floating-point number to convert.

Return Value

Type: Single
A single-precision floating-point number that is equivalent to value.value is rounded using rounding to nearest. For example, when rounded to two decimals, the value 2.345 becomes 2.34 and the value 2.355 becomes 2.36.
See Also