//1.小数点位数 string str1 = String.Format("{0:F1}", 56789); //result: 56789.0 string str2 = String.Format("{0:F2}", 56789); //result: 56789.00 string str3 = String.Format("{0:N1}", 56789); //result: 56,789.0 string str4 = String.Format("{0:N2}", 56789); //result: 56,789.00 string str5 = String.Format("{0:N3}", 56789); //result: 56,789.000 string str6 = (56789 / 100.0).ToString("#.##"); //result: 567.89 string str7 = (56789 / 100).ToString("#.##"); //result: 567 //2.保留N位,四舍五入 . decimal d = decimal.Round(decimal.Parse("0.55555"), 2);//0.56 //3.保留N位四舍五入 var r = Math.Round(0.55555, 2);//0.56