C# Convert ToSingle(Int32)
Description
Convert ToSingle(Int32)
converts the value of the specified
32-bit signed integer to an equivalent single-precision floating-point
number.
Syntax
Convert.ToSingle(Int32)
has the following syntax.
public static float ToSingle(
int value
)
Parameters
Convert.ToSingle(Int32)
has the following parameters.
value
- The 32-bit signed integer to convert.
Returns
Convert.ToSingle(Int32)
method returns A single-precision floating-point number that is equivalent to value.
Example
/* w ww . j a va2s . com*/
using System;
public class MainClass{
public static void Main(String[] argv){
System.Console.WriteLine(Convert.ToSingle((Int32)123));
}
}
The code above generates the following result.