Label -> Textformat
11.03.2005 16:07:48
Udo
ich habe folgendes Problem.
Ich errechne eine Zahl (Währung), die aus einer Variablen in einem Label angezeigt wird. Bei dem Ergebnis 0,50 steht dort aber nur 0,5.
Wie kann ich in dem Label die errechnete Euro-Zahl mit 2 Nachkommastellen darstellen lassen?
(In der Recherche habe ich nichts passendes (funktionierendes) gefunden.)
Hier mein bisheriger Code:
Private Sub ComboBox2_Change()
If ComboBox1.Value = "" Then Label4.Caption = "": Exit Sub
If ComboBox2.Value = "" Then Label4.Caption = "": Exit Sub
If ComboBox2.Value = "" Then ComboBox3.Visible = False: Exit Sub
w1 = Label3
w2 = ComboBox2.Value
w3 = w1 * w2
Label4.Caption = w3
ComboBox3.Visible = True
g1 = w3
Label17.Caption = w3
CommandButton6.Enabled = True
g1 = Label17.Caption
Label17.Caption = g1 + w3
g1 = Label17.Caption
'Label17 = Format(g1, "##,##0.00") <- funktionierte nicht !!
Label17.Caption = Format([g1], "###,##0.00") ' <- funktioniert auch nicht !!
End Sub
Vielen Dank im Voraus,
Udo