JuliaData / CSV.jl

Utility library for working with CSV and other delimited files in the Julia programming language
https://csv.juliadata.org/
Other
459 stars 141 forks source link

fix decchar handling in writecell() for AbstractFloat #1109

Open sara2512 opened 10 months ago

sara2512 commented 10 months ago

This PR fixes #1108.

Currently DecFP.Dec64 Floats are not handled correctly. Decimal character is not replaced.

using DecFP
using DataFrames
using CSV
io = IOBuffer() 
CSV.write(io, DataFrame(:a => Dec64(1)); decimal = ',')
String(take!(io))
# "a\n1.0\n"

With the PR in place the result is as expected.

CSV.write(io, DataFrame(:a => Dec64(1)); decimal = ',')
String(take!(io))
# "a\n1,0\n"