对于 10,我想要 10,而不是 10.00 对于 10.11 我想要 10.11
没有代码可以实现吗?即通过指定格式字符串类似于 {0:N2}
decimal num = 10.11M; Console.WriteLine( num.ToString( "0.##" ) );