stringstr1 =string.Format({0N1},56789); result 56,789.0
stringstr2 =string.Format({0N2},56789); result 56,789.00
stringstr3 =string.Format({0N3},56789); result 56,789.000
stringstr8 =string.Format({0F1},56789); result 56789.0
stringstr9 =string.Format({0F2},56789); result 56789.00
stringstr11 =(56789 100.0).ToString(#.##); result 567.89
stringstr12 =(56789 100).ToString(#.##); result 567
C 或 c
货币
Console.Write({0C}, 2.5); $2.50
Console.Write({0C}, -2.5); ($2.50)
D 或 d
十进制数
Console.Write({0D5}, 25); 00025
E 或 e
科学型
Console.Write({0E}, 250000); 2.500000E+005
F 或 f
固定点
Console.Write({0F2}, 25); 25.00
Console.Write({0F0}, 25); 25
G 或 g
常规
Console.Write({0G}, 2.5); 2.5
N 或 n
数字
Console.Write({0N}, 2500000); 2,500,000.00
X 或 x
十六进制
Console.Write({0X}, 250); FA
Console.Write({0X}, 0xffff); FFFF