设置ToString()的数据输出格式

double  MySalary = 8800.12;           
System.Globalization.CultureInfo MyCulture = new System.Globalization.CultureInfo("zh-CN");
 //简体中文,货币¥8,800.12
String MyInfo ="\n我的薪水是:"+ MySalary.ToString("C", MyCulture);
MessageBox.Show(MyInfo, "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information);

你可能感兴趣的:(toString)