-
-
Notifications
You must be signed in to change notification settings - Fork 399
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
Add practice exercise ledger
#1367
Conversation
Thank you for contributing to Based on the files changed in this PR, it would be good to pay attention to the following details when reviewing the PR:
Automated comment created by PR Commenter 🤖. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yaaay, Jie is contributing here again 😻
Some pieces of the code would only work on the given test cases, is that fair game?
Absolutely.
I'm approving, feel free to merge with or without making any more changes.
@type entry :: %{amount_in_cents: integer(), date: Date.t(), description: String.t()} | ||
|
||
@spec format_entries(currency(), String.t(), list(entry())) :: String.t() | ||
def format_entries(currency, locale, entries) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the locale could also get its own custom type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about it, I think I decided not to because somehow I thought capital letter were not allowed in atoms... But that's silly, so I made it a type after all :)
""" | ||
Date | Description | Change\s\s\s\s\s\s\s | ||
01/01/2015 | Freude schoner Gotterf... | ($1,234.56) | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean for the boilerplate solution to be failing this test? In the markdown exercise, the boilerplate passes all tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad! I made a value wrong on purpose, but I made it too wrong and somehow forgot to check :(
It has been a while since I added an exercise :)
This one got tests added a while back.
It's a refactor exercise, it was my first time doing it, I don't know if I went too far with the bad code.
Some pieces of the code would only work on the given test cases, is that fair game?