double n1 = 1.12, n2 = 1.1, n3 = 1.0, n4 = 1, n5 = 1.222; Console.WriteLine(n1.ToString("#0.00"));//1.12 Console.WriteLine(n2.ToString("#0.00"));//1.10 Console.WriteLine(n3.ToString("#0.00"));//1.00 Console.WriteLine(n4.ToString("#0.00"));//1.00 Console.WriteLine(n5.ToString("#0.00"));//1.22
String.Format("{0,5:0.00}", 原数据)