Click or drag to resize
ConvertToDecimal Method (Single)
Converts the value of the specified single-precision floating-point number to the equivalent decimal number.

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

Parameters

value
Type: SystemSingle
The single-precision floating-point number to convert.

Return Value

Type: Decimal
A decimal number that is equivalent to value.
Exceptions
ExceptionCondition
OverflowExceptionvalue is greater than MaxValue or less than MinValue.
See Also