111,093
社区成员




Console.WriteLine(Math.Round(1.041, 1));
显示的是1……Math.Round(1.20,1)
decimal d = 0.0000m;
string s = d.ToString();
if (s.IndexOf(".") > 0)
s = s.TrimEnd('0').TrimEnd('.');
decimal d = 1.0000m;
string s = d.ToString();
if (s.IndexOf(".") > 0)
s = s.Trim('0').Trim('.');