- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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
To Continue Learning Please Login
Login with Google