小编Bil*_*oel的帖子

从十进制计算中删除字符$

我试图总结一个具有值的列,但它们在值前面有"$"字符.

如何删除值前面的$以将其转换为小数,这样我就不会收到任何错误?

这是我用来执行此操作的代码:

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
    if (e.Row.DataItem != null)
    {
        // Set the capacity label text

        sum += Decimal.Parse(e.Row.Cells[4].Text);

        Label5.Text = "Total:"+" $" + sum.ToString();
    }
}
Run Code Online (Sandbox Code Playgroud)

c# asp.net

0
推荐指数
1
解决办法
47
查看次数

标签 统计

asp.net ×1

c# ×1