且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在asp.net datagrid值中添加分隔的逗号

更新时间:2023-02-15 22:23:55

试试这个,但你必须先验证它是一个数字。



Try this, but you have to validate that it is a number first.

string str =txtamount.Text;
dr["AMOUNT"] = (string.Format("{0:C}", Convert.ToDecimal(str))).Substring(1);