当前位置: 代码迷 >> ASP.NET >> 怎样把1234567.89转1,234,567.89解决思路
  详细解决方案

怎样把1234567.89转1,234,567.89解决思路

热度:6399   发布时间:2013-02-26 00:00:00.0
怎样把1234567.89转1,234,567.89
怎样把1234567.89转1,234,567.89 
  用什么语言都行  如c,c#,php,javascript等语言
  一般数据要转换成财务用的数据!
  指点一下!!!急!

------解决方案--------------------------------------------------------
string s = 1234567.89m.ToString( "N ");//1,234,567.89
s = 1234567.89m.ToString( "C ");//¥1,234,567.89
s = decimal.Parse( "1234567.89 ").ToString( "N ");//1,234,567.89
------解决方案--------------------------------------------------------
int i = 1234567.89;
string s = i.ToString( "C ");
------解决方案--------------------------------------------------------
double d = 1234567.89D;
System.Globalization.CultureInfo cultureInfo = new System.Globalization.CultureInfo( "en-US ");
this.textBox1.Text = d.ToString( "N ", cultureInfo);
------解决方案--------------------------------------------------------
double d = 12345678.99;
string s = d.ToString( "###,###,##0.00 ");
------解决方案--------------------------------------------------------
不错
  相关解决方案