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

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

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)
{