ConvertToSingle Method (Decimal) |
Converts the value of the specified decimal number to an equivalent single-precision floating-point number.
Namespace: SystemAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public static float ToSingle(
decimal value
)
Parameters
- value
- Type: SystemDecimal
The decimal number to convert.
Return Value
Type:
SingleA 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