您的位置:首页 > 其它

string 转 int 函数

2007-06-14 17:48 190 查看
     public decimal DealWithNullValueWithDecimal(string txtBox)
    {
        if (string.IsNullOrEmpty(txtBox.Trim()))
        {
            return 0;
        }
        else
        {
            decimal dec = 0m;
            try {
                dec = Convert.ToDecimal(txtBox.Trim().ToString());
            }
            catch(Exception ex)
            {
                Alert("转换出错");
            }
            finally
            {
              
            }
            return dec;
        }
    }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  string exception