using System;
class UsingStringFormat
{
static void Main()
{
string testString = "";
Console.WriteLine("格式字符串{0,10:p}");
testString = string.Format("数值0.32换算成为百分比等于{0,10:p}", 0.32);
Console.WriteLine(testString + "\n");
Console.WriteLine("格式字符串{0:#,###;#.##,00##,00}");
testString = string.Format("数值12.2345输出格式等于{0:#,###;#.##;00##,00}", 12.2345);
Console.WriteLine(testString + "\n");
Console.WriteLine("格式字符串{0:##.##;##.#;0.0#}");
testString = string.Format("数值-1235.33输出格式等于{0:##.##;##.#;0.0#}", -1235.33);
Console.WriteLine(testString + "\n");
Console.WriteLine("格式字符串{0:##.##;##.#;0.0#}");
testString = string.Format("数值0输出格式等于{0:##.##;(##.00);0.0#}", 0);
Console.WriteLine(testString + "\n");
Console.ReadLine();
}
}
程序中testString = string.Format("数值12.2345输出格式等于{0:#,###;#.##,00##,00}", 12.2345);逗号和分号有什么作用,程序中这几个Format有什么区别,程序执行的原理,请大侠们帮帮忙啊