Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
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
Advertisements
