C# Convert ToDouble(Object)

Description

Convert ToDouble(Object) converts the value of the specified object to a double-precision floating-point number.

Syntax

Convert.ToDouble(Object) has the following syntax.


public static double ToDouble(
  Object value
)

Parameters

Convert.ToDouble(Object) has the following parameters.

  • value - An object that implements the IConvertible interface, or null.

Returns

Convert.ToDouble(Object) method returns A double-precision floating-point number that is equivalent to value, or zero if value is null.

Example


//from www.  j av  a 2 s . c  om
using System;
public class MainClass{
  public static void Main(String[] argv){  
    Console.WriteLine(Convert.ToDouble((Object)78));
  }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version