mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-02 01:45:38 +08:00
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:
commit
107733e951
1 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue