截取小数点后几位的方法
/// <summary>
/// 用来截取小数点后nleng位
/// </summary>
/// <param name="sString">sString原字符串。</param>
/// <param name="nLeng">nLeng长度。</param>
/// <returns>处理后的字符串。</returns>
public string VarStr(string sString, int nLeng)
{
int index = sString.IndexOf(".");
if (index == -1 || index + nLeng >= sString.Length)
return sString;
else
return sString.Substring(0, (index + nLeng + 1));
}