

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 Decimal to Int64 (long) in C#
Use the Convert.ToInt64() method to convert Decimal to Int64 (long) in C#.
Let’s say we have a decimal variable.
decimal d = 310.23m;
Now to convert it to Int64, use the Convert.ToInt64() method.
long res; res = Convert.ToInt64(d);
Let us see another example −
Example
using System; class Demo { static void Main() { decimal d = 190.66m; long res; res = Convert.ToInt64(d); Console.WriteLine("Converted Decimal '{0}' to Int64 value {1}", d, res); } }
Output
Converted Decimal '190.66' to Int64 value 191
- Related Questions & Answers
- Convert long primitive to Long object in Java
- Convert String to Long in Java
- How to convert Long array list to long array in Java?
- Convert from String to long in Java
- Convert Decimal to Binary in Java
- C# program to convert string to long
- How to convert String to Long in Kotlin?
- How to Convert Binary to Decimal?
- How to Convert Decimal to Binary?
- How to Convert Decimal to Octal?
- How to Convert Decimal to Hexadecimal?
- How to Convert Hexadecimal to Decimal?
- C# Program to convert a Double value to an Int64 value
- Convert decimal integer to octal in Java
- Which MySQL data type is used for long decimal?
Advertisements