Different Ways to Convert Double to Integer in C# Last Updated : 12 Jul, 2025 Comments Improve Suggest changes Like Article Like Report Given a Double real number, the task is to convert it into Integer in C#. There are mainly 3 ways to convert Double to Integer as follows: Using Type CastingUsing Math.round()Using Decimal.ToInt32() Examples: Input: double = 3452.234 Output: 3452 Input: double = 98.23 Output: 98 1. Using Typecasting: This technique is a very simple and user friendly. Example: C# // C# program for type conversion from double to int using System; using System.IO; using System.Text; namespace GFG { class Geeks { // Main Method static void Main(string[] args) { double a = 3452.345; int b = 0; // type conversion b = (int)a; Console.WriteLine(b); } } } Output: 3452 2. Using Math.round(): This method returns the nearest integer. C# // C# program to demonstrate the // Math.Round(Double) method using System; class Geeks { // Main method static void Main(string[] args) { Double dx1 = 3452.645; // Output value will be 12 Console.WriteLine(Math.Round(dx1)); } } Output: 3452 3. UsingDecimal.ToInt32(): This method is used to convert the value of the specified Decimal to the equivalent 32-bit signed integer. C# // C# program to convert Double to Integer using System; public class Demo { public static void Main() { double val = 3452.345; int res = Convert.ToInt32(val); Console.WriteLine(res); } } Output: 3452 Comment More infoAdvertise with us Next Article C# | Convert.ToInt64(String, IFormatProvider) Method S ShivaTeja2 Follow Improve Article Tags : C# Write From Home Similar Reads C# | BitConverter.DoubleToInt64Bits() Method BitConverter.DoubleToInt64Bits(Double) Method is used to convert the specified double-precision floating point number to a 64-bit signed integer. Syntax: public static long DoubleToInt64Bits (double value); Here, the value is the number which is to be converted. Return Value: This method returns a 6 2 min read C# | Convert.ToInt16(String, IFormatProvider) Method This method is used to convert the specified string representation of a number to an equivalent 16-bit signed integer, using the specified culture-specific formatting information. Syntax: public static short ToInt16 (string value, IFormatProvider provider); Parameters: value: It is a string that con 4 min read C# | Convert.ToInt32(String, IFormatProvider) Method This method is used to converts the specified string representation of a number to an equivalent 32-bit signed integer, using the specified culture-specific formatting information. Syntax: public static int ToInt32 (string value, IFormatProvider provider); Parameters: value: It is a string that cont 4 min read C# | Convert.ToInt64(String, IFormatProvider) Method This method is used to converts the specified string representation of a number to an equivalent 64-bit signed integer, using the specified culture-specific formatting information. Syntax: public static long ToInt64 (string value, IFormatProvider provider); Parameters: value: It is a string that con 4 min read C# | Convert.ToByte(String, IFormatProvider) Method This method is used to convert the specified string representation of a number to an equivalent 8-bit unsigned integer, using specified culture-specific formatting information.Syntax: public static byte ToByte (string value, IFormatProvider provider); Parameters: value: It is a string that contains 4 min read C# | Convert.ToSByte(String, IFormatProvider) Method This method is used to convert the specified string representation of a number to an equivalent 8-bit signed integer, using the specified culture-specific formatting information. Syntax: public static sbyte ToSByte (string value, IFormatProvider provider); Parameters: value: It is a string that cont 4 min read Like