felixbuenemann / xlsxtream

Streaming & Fast XLSX Spreadsheet Writer for Ruby
MIT License
216 stars 38 forks source link

Additional quotation symbol is added to cells with text that is number #36

Open romanoff opened 5 years ago

romanoff commented 5 years ago

I have tried couple of ruby libraries (this one and https://github.com/Paxa/fast_excel ) and when I am just trying to create cell with text that has numeric value:

Xlsxtream::Workbook.open('my_data.xlsx') do |xlsx|
  xlsx.write_worksheet 'Sheet1' do |sheet|
    # Boolean, Date, Time, DateTime and Numeric are properly mapped
    sheet << ["2019"]
  end
end

when I open my_data.xlsx then 2019 cell is shown with '2019 value, not just 2019. Is there a way to change that? (didn't have a chance to use Excel for now, only used LibreOffice 5 and 6)

felixbuenemann commented 5 years ago

Why are you assigning a text when you want a numeric value?

felixbuenemann commented 5 years ago

Btw. if you have no control over the data types in the column values, you could pass the auto_format: true option to write_worksheet to enable data type guessing from text.

sandstrom commented 3 years ago

Is this an issue with the code itself, or a general question? For general questions Stackoverflow or Github Discussions (if one is setup for this repo) is better than Github.