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;
}
}
So i have these codes. How do i add the two strings, cb and cu together? I've tried doing
decimal totalprice;
totalprice = cu + cb;
but it says the name does not exist in the context.
What should i do??
i'm using windows form btw
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…