CSV.jl
CSV.jl copied to clipboard
CSV.write - floats
When outputting floats when writing a CSV file it would be nice to allow users to control what kind of notation should be used (maybe allow to pass a formatter). The issue is that:
- sometimes you are OK with the default
- sometimes you may want to enforce scientific notation
- sometimes you might want to enforce rounding (this is needed when later you want to read in the file using other software that does not accept that many decimal digits as are normally printed by Julia - what I mean is that eg.
3.141592653589793is parsed incorrectly by some readers and you need to round it to e.g. 8 decimal digits)
This is a minor issue.
Marking as 1.X milestone, meaning I don't plan on implementing this before 1.0 release (which will happen soon). I was originally hoping https://github.com/JuliaLang/julia/pull/32859 would land in a reasonable amount of time, but alas, it has fallen by the wayside of paltry review. My next solution is to just put the functionality in a package and we can use it here.
@quinnj any update on this feature? We are working on a project where we need to export the floating point numbers without scientific notation. Any option to save all floating point numbers with a fixed number of decimals?
No update as of yet, but I'm hoping to have time to address this soon as we do a blitz on CSV open issues.
I agree with @bkamins. Would be great if this could be fixed. A single notation makes it easier to share data with people using other programming languages.