-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
ledger #316
ledger #316
Conversation
Hello 👋 Thanks for your PR. This repo does not currently have dedicated maintainers. Our cross-track maintainers team will attempt to review and merge your PR, but it will likely take longer for your PR to be reviewed. If you enjoy contributing to Exercism and have a track-record of doing so successfully, you might like to become an Exercism maintainer for this track. Please feel free to ask any questions, or chat to us about anything to do with this PR or the reviewing process on the Exercism forum. (cc @exercism/cross-track-maintainers) |
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 a first iteration, good job!
let currency = Currency::USD; | ||
let locale = Locale::en_US; | ||
let entries = array![ | ||
("2015-01-01", "Buy present", "-1000"), ("2015-01-02", "Get present", "1000") |
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.
("2015-01-01", "Buy present", "-1000"), ("2015-01-02", "Get present", "1000") | |
("2015-01-02", "Get present", "1000"), ("2015-01-01", "Buy present", "-1000"), |
These entries should be switched
let entries = array![ | ||
("2015-01-01", "Something", "-1"), | ||
("2015-01-01", "Something", "0"), | ||
("2015-01-01", "Something", "1") |
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.
Place entries in the correct order
// Format the date based on the locale | ||
let formatted_date = format_date(@date, @locale); | ||
|
||
// Format the change based on the currency and locale |
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.
Move this comment above the function definition
|
||
// Step 2: Process transactions | ||
for ( | ||
date, transaction, change |
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.
date, transaction, change | |
date, description, amount_in_cents |
as per canonical data, the names are much clearer now
(year, month, day) | ||
} | ||
|
||
fn format_change(change: @ByteArray, currency: @Currency, locale: @Locale) -> ByteArray { |
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.
fn format_change(change: @ByteArray, currency: @Currency, locale: @Locale) -> ByteArray { | |
fn format_amount(amount_in_cents: @ByteArray, currency: @Currency, locale: @Locale) -> ByteArray { |
@Falilah what happened, why did you close the PR? 😮 |
I was having conflicts issue, so I did git rebase and all my work cleared, I am trying to bring them up by writing it back. |
Ah, no problem! It happens, and it's frustrating every time it does... Once you revert everything, feel free to reopen the PR, I'll get a notification |
Closes #196