-
Notifications
You must be signed in to change notification settings - Fork 936
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
#1750 bad show of csv #1890
base: dev
Are you sure you want to change the base?
#1750 bad show of csv #1890
Conversation
7a6873e
to
da1be88
Compare
@@ -124,7 +124,7 @@ class HabitsCSVExporter( | |||
val dateFormat = DateFormats.getCSVDateFormat() | |||
for ((timestamp, value) in entries.getKnown()) { | |||
val date = dateFormat.format(timestamp.toJavaDate()) | |||
out.write(String.format(Locale.US, "%s,%d\n", date, value)) | |||
out.write(String.format(Locale.US, "%s,%.3f\n", date, value.toDouble() / 1000.0)) |
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.
This is a quite dangerous move to use %.3f
here. The better approach would be to use opencsv
library, to a have a somewhat standardized approach with these things (the dot in fraction point might be some headache maker).
Did not do it, because it would need a separate MR definitively.
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.
... also the 1000 thing should be standardized somehow, cause it could be often forgotten using this value.
da1be88
to
c5f779f
Compare
Thanks for the PR, @foralost. I few comments:
|
c5f779f
to
1a867fe
Compare
I will look & test it in the next week to finish this PR |
a02de47
to
87f51d8
Compare
Ready for review. |
jesus
Yes, there are ;) will look today |
ok, i setup whole env on ubuntu (previously worked on Windows). I am still fighting with testExportCSV for whatever reason (the temp file is empty???) However the DateUtils test is failing on
I will resume playing with it probably on Sunday. |
7f6f6ed
to
2e29c6d
Compare
2e29c6d
to
5b291b9
Compare
Converting values to respective Doubles from Ints (making the dot 'visible').
Adding
Units
column doHeader.csv
.Closes #1750.