当前位置:编程学习 > C#/ASP.NET >>

GridView1_RowDataBound事件。汇总角标

  If e.Row.RowType = DataControlRowType.DataRow Then
            ' add the UnitPrice and QuantityTotal to the running total variables
             fare_fee_Sum+= Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, _
              "fare_fee"))

 ElseIf e.Row.RowType = DataControlRowType.Footer Then

         e.Row.Cells(8).Text = fare_fee_Sum.ToString("C")

end if

最后出来的值为什么都是 保留整数阿。。
我想保留小数
 ( 羊20.01)那个钱的符号不好打。。。。谢谢了。。。


--------------------编程问答-------------------- fare_fee_Sum.ToString( "N2")
如2.57148
N1代表一位小数 2.5
N3代表五位 2.571 --------------------编程问答-------------------- 但是我想要 那个人民币符号阿。。。 --------------------编程问答-------------------- e.Row.Cells(8).Text=string.Format("羊{0:N2}",fare_fee_Sum)   
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,