Horst1945
Cadet 4th Year
- Registriert
- Okt. 2014
- Beiträge
- 106
Hallo,
ich habe da ein kleines Problem:
Wie kann ich, das eine 0 nach dem 1,10 in der Variable "public double zahl" angezeigt wird?

Hier der Code:
Hat da jemand eine Idee?
Horst
ich habe da ein kleines Problem:
Wie kann ich, das eine 0 nach dem 1,10 in der Variable "public double zahl" angezeigt wird?

Hier der Code:
Code:
private void PreiBerechnen(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (Char)Keys.Enter)
{
txtErgebnis.Text = myClass.berechnenX(Convert.ToString(txtZahl1.Text), Convert.ToString(txtZahl2.Text));
berech1 = Convert.ToDouble(txtErgebnis.Text);
berech1 = Math.Round(berech1, 2);
txtZwSumme.Text = txtErgebnis.Text;
MwSt1 = (berech1 / 100 ) * MwSt;
MwSt1 = Math.Round(MwSt1, 2);
MwStGesamt = Convert.ToString(MwSt1);
txtMwst.Text = Convert.ToString(MwStGesamt);
berech = berech1 + MwSt1;
berech = Math.Round(berech, 2);
Gesamt1 = Convert.ToString(berech);
txtGsSumme.Text = Gesamt1;
}
}
Hat da jemand eine Idee?
Horst