- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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
C# Program to convert a Double value to an Int64 value
To convert a Double value to an Int64 value, use the Convert.ToInt64() method.
Int64 represents a 64-bit signed integer.
Let’s say the following is our double value.
double val = 23.951213e12;
Now to convert it to Int64.
long longVal = Convert.ToInt64(val);
Let us see the complete example.
Example
using System; public class Demo { public static void Main() { double val = 23.951213e12; long longVal = Convert.ToInt64(val); Console.WriteLine("Converted double {0:E} to Int64 {1:N0} value ", val, longVal); } }
Output
Converted double 2.395121E+013 to Int64 23,951,213,000,000 value
- Related Articles
- C# Program to convert a Double to an Integer Value
- C# Program to convert a Byte value to an Int32 value
- C# Program to convert an Int32 value to a decimal
- Convert double value to string in Java
- How to convert a double value to String in Java?
- Convert a specified value to an equivalent Boolean value in C#
- Java Program to convert an int value to String
- Convert Decimal to Int64 (long) in C#
- 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?
- C++ Program to convert int Variables into double
- Java Program to convert boolean value to Boolean
- Java Program to convert a Primitive Type Value to a String
- C++ Program to convert double type Variables into int
- Java Program to convert String to Double

Advertisements