// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Globalization; namespace E { class MainClass { public static void Main(string[] args) { double x = 12.34; Console.WriteLine(x); Console.WriteLine(x.ToString(new CultureInfo("en-US", false))); Console.WriteLine(String.Format("{0:f5}", x)); Console.WriteLine(String.Format(new CultureInfo("en-US", false), "{0:f5}", x)); Console.WriteLine(String.Format("{0,11:f5}", x)); Console.WriteLine(String.Format(new CultureInfo("en-US", false), "{0,11:f5}", x)); } } }