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.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
