public void button1_Click(object sender, EventArgs e)
{
if (cushioncheckBox.Checked)
{
decimal totalamtforcushion = 0m;
totalamtforcushion = 63m * cushionupDown.Value;
string cu = totalamtforcushion.ToString("C");
cushioncheckBox.Checked = false;
cushionupDown.Value = 0;
}
if (cesarbeefcheckBox.Checked)
{
decimal totalamtforcesarbeef = 0m;
totalamtforcesarbeef = 1.9m * cesarbeefupDown.Value;
string cb = totalamtforcesarbeef.ToString("C");
cesarbeefcheckBox.Checked = false;
cesarbeefupDown.Value = 0;
}
}
所以我有这些代码。我如何将两个字符串 cb 和 cu 加在一起?我试过做
decimal totalprice;
totalprice = cu + cb;
但它说该名称在上下文中不存在。我应该怎么办??
我正在使用 Windows 表单顺便说一句