Format saldo display in MainForm to include currency symbol and two decimal places

This commit is contained in:
vista-man committed 2025-01-27 19:12:52 +01:00
1 parent 5a626eeb37
commit 5398029353
12 files changed
+6 -6

No files matched your search

+3 -3
View File
@@ -87,7 +87,7 @@ public class MainForm : Form
saldoLabel = new Label()
{
Text = $"Saldo: {mijnRekening.ControleerSaldo()}",
Text = $"Saldo: €{mijnRekening.ControleerSaldo():N2}",
Top = 20,
Left = 20,
Width = 200,
@@ -152,7 +152,7 @@ public class MainForm : Form
{
decimal bedrag = decimal.Parse(bedragTextBox.Text);
mijnRekening.Storten(bedrag);
saldoLabel.Text = $"Saldo: {mijnRekening.ControleerSaldo()}";
saldoLabel.Text = $"Saldo: €{mijnRekening.ControleerSaldo():N2}";
}
catch (Exception ex)
{
@@ -166,7 +166,7 @@ public class MainForm : Form
{
decimal bedrag = decimal.Parse(bedragTextBox.Text);
mijnRekening.Opnemen(bedrag);
saldoLabel.Text = $"Saldo: {mijnRekening.ControleerSaldo()}";
saldoLabel.Text = $"Saldo: €{mijnRekening.ControleerSaldo():N2}";
}
catch (Exception ex)
{