Decimal的疑问
String str= "12.11 ";
Decimal dec = Convert.ToDecimal(str);
String str1 = Math.Round(dec,2);
结果str1= "12.00 "
如何能保证小数点后的能保留下来呢?
------解决方案--------------------String str = "12.11 ";
Decimal dec = Convert.ToDecimal(str);
String str1 = Convert.ToString(Math.Round(dec + 0.001m, 2));