Format integer with default formatting
using System;
using System.Globalization;
public class Example
{
public static void Main()
{
int[] numbers = { -111, 0, 169, 11111 };
foreach (int number in numbers) {
// Display value using default formatting.
Console.Write("{0,-8} --> ", number.ToString());
}
}
}
//-111 --> 0 --> 169 --> 11111 -->
Related examples in the same category