Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

734 use decimal for money #737

Merged
merged 8 commits into from
Dec 17, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updated BankAccount example
Andrew Huang authored and Andrew Huang committed Dec 17, 2018
commit 7a7006e1a7e2e1f9502deef825a7f144c0180498
6 changes: 3 additions & 3 deletions exercises/bank-account/Example.cs
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ public class BankAccount
{
private readonly object _lock = new object();

private float balance;
private decimal balance;
private bool isOpen;

public void Open()
@@ -23,7 +23,7 @@ public void Close()
}
}

public float Balance
public decimal Balance
{
get
{
@@ -39,7 +39,7 @@ public float Balance
}
}

public void UpdateBalance(float change)
public void UpdateBalance(decimal change)
{
lock(_lock)
{