1 /// <summary> 4 /// 去除后面多余的零 5 /// </summary> 6 /// <param name="dValue"></param> 7 /// <returns></returns> 8 private string RemoveZero(decimal dValue) 9 { 10 string sResult = dValue.ToString(); 11 if (sResult.IndexOf(".") < 0) 12 return sResult; 13 int iIndex = sResult.Length - 1; 14 for (int i = sResult.Length - 1; i >= 0; i--) 15 { 16 if (sResult.Substring(i, 1) != "0") 17 { 18 iIndex = i; 19 break; 20 } 21 } 22 sResult = sResult.Substring(0, iIndex + 1); 23 if (sResult.EndsWith(".")) 24 sResult = sResult.Substring(0, sResult.Length - 1); 25 return sResult; 26 }