Skip to content

Commit

Permalink
Add support in excel to report last calculated val for formulas
Browse files Browse the repository at this point in the history
Previously with parseexcel this was not possible. Will add more formula functionality as it's available from ruby-spreadsheet
  • Loading branch information
Hugh McGowan committed Jun 28, 2009
1 parent 45e37e0 commit cf06814
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
3 changes: 2 additions & 1 deletion lib/roo/excel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def read_cells(sheet=nil)
(0..row.size).each do |cell_index|
cell = row.at(cell_index)
next if cell.nil? #skip empty cells
next if cell.class == Spreadsheet::Formula
next if cell.class == Spreadsheet::Formula && cell.value.nil? # skip empty formla cells
if date_or_time?(row, cell_index)
vt, v = read_cell_date_or_time(row, cell_index)
else
Expand Down Expand Up @@ -438,6 +438,7 @@ def read_cell_date_or_time(row, idx)
# return the values for Roo
def read_cell(row, idx)
cell = row.at(idx)
cell = cell.value if cell.class == Spreadsheet::Formula
case cell
when Float, Integer, Fixnum, Bignum
value_type = :float
Expand Down
18 changes: 0 additions & 18 deletions test/numbers1_excel.csv

This file was deleted.

0 comments on commit cf06814

Please sign in to comment.