vc++ 格式化数字成3位3位显示

如题

 CultureInfo^ MyCI = gcnew CultureInfo( "en-US",false );
			 NumberFormatInfo^ nfi = MyCI->NumberFormat;
			//  nfi->CurrencyDecimalDigits = 0; 
			nfi->NumberDecimalDigits = 0;
			// Displays a value with the default separator (S".").
			Int64 myInt = 12345678;
			nfi->CurrencyDecimalSeparator = ",";
			this->TB_Show->Text =  myInt.ToString( "N", nfi ) ;


以下代码未测试通过:
 String^ str = gcnew String("12345");
				 String^ res;
				 CultureInfo^ MyCI = gcnew CultureInfo( "en-US",false );
				 NumberFormatInfo^ nfi = MyCI->NumberFormat;
				 nfi->CurrencyDecimalDigits = 0;
				 nfi->CurrencyDecimalSeparator = ",";
				 res = String::Format("###,#",str);

你可能感兴趣的:(vc++)