<asp:BoundField DataField="QianShouEr" HeaderText="欠收额(元)" DataFormatString="{0:C}" HtmlEncode="false">
                        <HeaderStyle BorderColor="Black" BorderWidth="1px" HorizontalAlign="Center" VerticalAlign="Middle"
                            Width="70px" />
                        <ItemStyle BorderColor="Black" BorderWidth="1px" ForeColor="Red" HorizontalAlign="Center"
                            Width="75px" />
</asp:BoundField>

页面显示为:¥23,456.00。

要求转换成Decimal/double格式进行数学运算

方法如下:

string b=¥23,456.00;

decimal   c   =   Convert.ToDecimal(b.Replace( "¥ ",   " ").trim());

this.lblYSE.Text = c.ToString("C");

页面显示为:¥23,456.00。


 

posted on 2011-08-15 10:56  易尔购  阅读(713)  评论(0编辑  收藏  举报