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

improve CsvTransactionsExporter #166

Merged
merged 2 commits into from
Jul 23, 2024
Merged

Conversation

hades
Copy link

@hades hades commented Jun 29, 2024

Convert to Kotlin, and fix minor issues.

@@ -53,7 +53,7 @@
* @author Ngewi Fet <[email protected]>
* @author Yongxin Wang <[email protected]>
*/
public abstract class Exporter implements Closeable {
public abstract class Exporter {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not Closeable ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I mentioned in the commit description, the subclasses of Exporter already call close() in generateExport(), so there is no need for the users of the class to call close().

hades added 2 commits July 18, 2024 13:50
Since the subclasses call close() on their own in generateExport(),
there is no need for the users of these classes to close the exporters.
Convert the code to Kotlin, make sure the CsvWriter is closed in case of
exceptions, and fix string formatting in Money.

The latter change removes the `Money.toLocaleString` method which
converted the amount to a double and formatted it with two decimal
places (instead of the currency-appropriate formatting).
@hades
Copy link
Author

hades commented Jul 18, 2024

PTAL, since this is related to #169

@Kaligula0 Kaligula0 merged commit 8f335b9 into GnuCash-Pocket:master Jul 23, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants