
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
Convert.ToDouble Method in C#
To convert a specified value to a double-precision floating-point number, use Convert.ToDouble() method.
The following is our long value −
long[] val = { 340, -200};
Now convert it to Double.
double result; result = Convert.ToDouble(val);
Example
using System; public class Demo { public static void Main() { long[] val = { 340, -200}; double result; // long to double foreach (long number in val) { result = Convert.ToDouble(number); Console.WriteLine("Converted {0} value to {1}",number, result); } } }
Output
Converted 340 value to 340 Converted -200 value to -200
- Related Articles
- How to Convert the TimeSeries using the series.asfreq() method?
- Convert Long into String using toString() method of Long class in java
- Is there any method to convert a Set to immutable in Java
- Convert an object to another type using map() method with Lambda in Java?
- What is the equivalent of MySQL TIME_TO_SEC() method in PHP to convert datetime to seconds?
- Java Program to convert Double into String using toString() method of Double class
- How to convert a double value into a Java String using format method?
- How to convert a double value into a Java String using append method?
- Convert Class in C#
- Class method vs static method in Python
- Collections.replaceAll() method and List.replaceAll() method in Java
- The isEmpty() method of CopyOnWriteArrayList method in Java
- The hashCode() method of CopyOnWriteArrayList method in Java
- The clone() method of CopyOnWriteArrayList method in Java
- Default method vs static method in an interface in Java?
- Convert String to Long in Java

Advertisements