try
{
decimal s1, s2, s3;
s1 = decimal.Parse(txtBox1.Text.Trim());
s2 = decimal.Parse(txtBox2.Text.Trim());
s3 = decimal.Parse(txtBox3.Text.Trim());
string myStr = Convert.ToString(s1 * s2 - s3);
System.Globalization.NumberFormatInfo provider = new System.Globalization.NumberFormatInfo();
provider.NumberDecimalDigits = 3; //要設定的小數位數
double mystr = Convert.ToDouble(myStr);
txtBOX.Text = mystr.ToString(provider);
}
catch (Exception el)
{
//MessageBox.Show(el.Message);
}
总是报错 "输入格式错误"