Format integer with 1 decimal digit in CSharp
Description
The following code shows how to format integer with 1 decimal digit.
Example
using System;//from ww w .j a v a2 s . c o m
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.WriteLine("{0,N1}", number);
}
}
}