decimal
decTemp = 2.1m;
Console.WriteLine(decTemp.ToString(
"#0.00"
));
//输出2.10
Console.WriteLine(decTemp.ToString(
"#.##"
));
//输出2.1
Console.ReadLine();
decimal
decTemp = 2.1m;
Console.WriteLine(decTemp.ToString(
"#0.00"
));
//输出2.10
Console.WriteLine(decTemp.ToString(
"#.##"
));
//输出2.1
Console.ReadLine();