private void btn_TwoPound_Click(object sender, EventArgs e) { double TwoPound = double.Parse(label_TwoPoundTotal.Text); TwoPound = TwoPound + 2.00; label_TwoPoundTotal.Text = TwoPound.ToString(); TwoPound++; int TwoPoundLabel = int.Parse(label_TwoPoundCount.Text); TwoPoundLabel = TwoPoundLabel + 1; label_TwoPoundCount.Text = TwoPoundLabel.ToString(); TwoPoundLabel++; double Total; Total = (double.Parse(label_TwoPoundTotal.Text) + double.Parse(label_OnePoundTotal.Text) + double.Parse(label_FiftyPenceTotal.Text) + double.Parse(label_TwentyPenceTotal.Text) + double.Parse(label_TenPenceTotal.Text) + double.Parse(label_FivePenceTotal.Text) + double.Parse(label_TwoPenceTotal.Text) + double.Parse(label_OnePenceTotal.Text)); textbox_Total.Text = Total.ToString(); double PenceTotal; PenceTotal = ((double.Parse(label_TwoPoundTotal.Text) * 100) + (double.Parse(label_OnePoundTotal.Text) * 100) + (double.Parse(label_FiftyPenceTotal.Text) * 100) + (double.Parse(label_TwentyPenceTotal.Text) * 100) + (double.Parse(label_TenPenceTotal.Text) * 100) + (double.Parse(label_FivePenceTotal.Text) * 100) + (double.Parse(label_TwoPenceTotal.Text) * 100) + (double.Parse(label_OnePenceTotal.Text) * 100)); textbox_TotalPence.Text = PenceTotal.ToString(); }
private void btn_FiftyPence_Click(object sender, EventArgs e) { double FiftyPence = double.Parse(label_FiftyPenceTotal.Text); FiftyPence = FiftyPence + 0.50; label_FiftyPenceTotal.Text = FiftyPence.ToString(); int FiftyPenceLabel = int.Parse(label_FiftyPenceCount.Text); FiftyPenceLabel = FiftyPenceLabel + 1; label_FiftyPenceCount.Text = FiftyPenceLabel.ToString(); FiftyPenceLabel++; double Total; Total = (double.Parse(label_TwoPoundTotal.Text) + double.Parse(label_OnePoundTotal.Text) + double.Parse(label_FiftyPenceTotal.Text) + double.Parse(label_TwentyPenceTotal.Text) + double.Parse(label_TenPenceTotal.Text) + double.Parse(label_FivePenceTotal.Text) + double.Parse(label_TwoPenceTotal.Text) + double.Parse(label_OnePenceTotal.Text)); textbox_Total.Text = Total.ToString(); double PenceTotal; PenceTotal = ((double.Parse(label_TwoPoundTotal.Text) * 100) + (double.Parse(label_OnePoundTotal.Text) * 100) + (double.Parse(label_FiftyPenceTotal.Text) * 100) + (double.Parse(label_TwentyPenceTotal.Text) * 100) + (double.Parse(label_TenPenceTotal.Text) * 100) + (double.Parse(label_FivePenceTotal.Text) * 100) + (double.Parse(label_TwoPenceTotal.Text) * 100) + (double.Parse(label_OnePenceTotal.Text) * 100)); textbox_TotalPence.Text = PenceTotal.ToString(); }
private void btn_OnePence_Click(object sender, EventArgs e) { double OnePence = double.Parse(label_OnePenceTotal.Text); OnePence = OnePence + 0.01; label_OnePenceTotal.Text = OnePence.ToString(); int OnePenceLabel = int.Parse(label_OnePenceCount.Text); OnePenceLabel = OnePenceLabel + 1; label_OnePenceCount.Text = OnePenceLabel.ToString(); OnePenceLabel++; double Total; Total = (double.Parse(label_TwoPoundTotal.Text) + double.Parse(label_OnePoundTotal.Text) + double.Parse(label_FiftyPenceTotal.Text) + double.Parse(label_TwentyPenceTotal.Text) + double.Parse(label_TenPenceTotal.Text) + double.Parse(label_FivePenceTotal.Text) + double.Parse(label_TwoPenceTotal.Text) + double.Parse(label_OnePenceTotal.Text)); String.Format("{0:n2}", Convert.ToDouble(label_OnePenceTotal.Text)); textbox_Total.Text = Total.ToString(); double PenceTotal; PenceTotal = ((double.Parse(label_TwoPoundTotal.Text) * 100) + (double.Parse(label_OnePoundTotal.Text) * 100) + (double.Parse(label_FiftyPenceTotal.Text) * 100) + (double.Parse(label_TwentyPenceTotal.Text) * 100) + (double.Parse(label_TenPenceTotal.Text) * 100) + (double.Parse(label_FivePenceTotal.Text) * 100) + (double.Parse(label_TwoPenceTotal.Text) * 100) + (double.Parse(label_OnePenceTotal.Text) * 100)); textbox_TotalPence.Text = PenceTotal.ToString(); }