【发布时间】:2015-10-20 19:00:39
【问题描述】:
我在这里定义价格:
lblPrisGrill.Text = "20,00 ,-"; // Grill
lblPrisWiener.Text = "25,00 ,-"; // Wiener
lblPrisBacon.Text = "35,00 ,-"; // Bacon
lblPrisOst.Text = "30,00 ,-"; // Oste
我将价格从字符串解析为双倍(数字):
if (rbGrill.Checked == true)
PrisMeny = double.Parse(lblPrisGrill.Text);
else if (rbWiener.Checked == true)
PrisMeny = double.Parse(lblPrisWiener.Text);
else if (rbBacon.Checked == true)
PrisMeny = double.Parse(lblPrisBacon.Text);
else if (rbOst.Checked == true)
PrisMeny = double.Parse(lblPrisOst.Text);
我想知道我如何只能得到号码"##,##" 而忽略" ,-"。
我知道存在解释这一点的资源,但我想知道如果我有多个任务会怎样,并看看它会如何完成。
【问题讨论】: