Merge pull request #2517 from urbanrotnik/ur-sci-4566-fix-value-rounding

Fix value rounding for General excel cell type [SCI-4566]
This commit is contained in:
Urban Rotnik 2020-04-23 07:57:13 +02:00 committed by GitHub
commit 107733e951
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -53,7 +53,13 @@ class SpreadsheetParser
def self.parse_row(row, sheet)
if sheet.is_a?(Roo::Excelx)
row.map { |cell| cell&.formatted_value }
row.map do |cell|
if cell.is_a?(Roo::Excelx::Cell::Number) && cell.format == 'General'
cell&.value&.to_d
else
cell&.formatted_value
end
end
else
row.map(&:to_s)
end