Format integer with 1 decimal digit
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 with 1 decimal digit.
Console.Write("{0,13:N1}", number);
}
}
}
// -111.0 0.0 169.0 11,111.0
Related examples in the same category