SciRuby / daru-io

daru-io is a plugin gem to the existing daru gem, which aims to add support to Importing DataFrames from / Exporting DataFrames to multiple formats.
http://www.rubydoc.info/github/athityakumar/daru-io/master/
MIT License
24 stars 9 forks source link

Better :convert_comma for CSV Exporter #42

Open athityakumar opened 7 years ago

athityakumar commented 7 years ago

As per PR #34, the :convert_comma option when set to true, works with the following -

str =~ /^\d+./ ? str.tr('.',',') : str

This works mostly, but seems a bit fragile and could be more battle-tested.