读书人

double转string的有关问题

发布时间: 2012-05-28 17:59:33 作者: rapoo

double转string的问题
textBox3.Text = Convert.ToInt32(textBox1.Text) * (0.003102 * 17.16 + 0.1);

无法将类型“double”隐式转换为“string”,

textbox1.Text,这个值怎么转?

[解决办法]
float f = Convert.ToInt32(textBox1.Text) * (0.003102 * 17.16 + 0.1);
textBox3.Text = f.ToString();
[解决办法]

C# code
if (comboBox1.Text == "新胶袋" && comboBox2.Text == "5.5cm"){  double f;  f= double.Parse(textBox1.Text) * (0.003102 * 17.16 + 0.1);  textBox3.Text=f.ToString();} 

读书人网 >C#

热点推荐