martijn / xsv

High performance, lightweight .xlsx parser for Ruby that provides nothing a CSV parser wouldn't
https://storck.io/posts/announcing-xsv-1-0-0/
MIT License
194 stars 20 forks source link

decimal records are not processed correctly #16

Closed crepon-philipp closed 4 years ago

crepon-philipp commented 4 years ago

I have a file containing multiple decimal values. 0.001 | 0.01 | 0.1

when parsing the data as described in README the first decimal is not returned correctly!

This is what I do:

x = Xsv::Workbook.open("sheet.xlsx")
sheet = x.sheets[0]
sheet.each_row do |row|
  p '---row', row
end

This is what I see in the console (the first value is just 1 instead of 0.001): [1, 0.01, 0.1]

martijn commented 4 years ago

Could you share your file? My email address is in my profile.

martijn commented 4 years ago

Turns out the value was stored as a complex number in the XML (1E-3). Haven't seen that before and didn't notice it in the specification either. This is fixed in Xsv 0.3.16.