Int32.ToString Converts the numeric value of this instance to its equivalent string representation.
using System;
using System.Globalization;
public class ParseInt32
{
public static void Main()
{
int value = -16325;
// Display value using default ToString method.
Console.WriteLine(value.ToString());
// Display value using some standard format specifiers.
Console.WriteLine(value.ToString("G"));
Console.WriteLine(value.ToString("C"));
Console.WriteLine(value.ToString("D"));
Console.WriteLine(value.ToString("F"));
Console.WriteLine(value.ToString("N"));
Console.WriteLine(value.ToString("X"));
}
}
/*
-16325
-16325
($16,325.00)
-16325
-16325.00
-16,325.00
FFFFC03B
*/
Related examples in the same category