- 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.ToInt64 Method in C#
Convert a specified value to a 64-bit signed integer using Convert.ToInt64 Method.
Let us take a double value.
double doubleNum = 193.834;
Now, convert it to Int64 i.e. long.
long res; res = Convert.ToInt32(doubleNum);
Example
using System; public class Demo { public static void Main() { double doubleNum = 193.834; long res; res = Convert.ToInt32(doubleNum); Console.WriteLine("Converted {0} to {1}", doubleNum, res); } }
Output
Converted 193.834 to 194
Advertisements