C# Convert ToDouble(Boolean)
Description
Convert ToDouble(Boolean)
converts the specified Boolean
value to the equivalent double-precision floating-point number.
Syntax
Convert.ToDouble(Boolean)
has the following syntax.
public static double ToDouble(
bool value
)
Parameters
Convert.ToDouble(Boolean)
has the following parameters.
value
- The Boolean value to convert.
Returns
Convert.ToDouble(Boolean)
method returns The number 1 if value is true; otherwise, 0.
Example
/*from w w w . j a v a 2s .c om*/
using System;
public class MainClass{
public static void Main(String[] argv){
Console.WriteLine(Convert.ToDouble(true));
}
}
The code above generates the following result.