From bfa067993a256b2a7e246f45deb96e25fc0be1d7 Mon Sep 17 00:00:00 2001 From: Federico Sosa Date: Tue, 14 Feb 2017 17:31:07 -0300 Subject: [PATCH 1/4] Return calculated formula instead of text value --- lib/spreadsheet.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/spreadsheet.js b/lib/spreadsheet.js index 7055e51..3c4057a 100644 --- a/lib/spreadsheet.js +++ b/lib/spreadsheet.js @@ -503,13 +503,15 @@ Spreadsheet.prototype.receive = function(options, callback) { _.each(entries, function(entry) { var cell = entry['gs:cell'], r = cell.row, - c = cell.col; + c = cell.col, + cellContent = (entry.content != undefined) ? entry.content : ''; if (!rows[r]) { info.totalRows++; rows[r] = {}; } - - rows[r][c] = util.gcell2cell(cell, options.getValues, _this.opts.useCellTextValues); + + rows[r][c] = cellContent != '' ? cellContent : util.gcell2cell(cell, options.getValues, _this.opts.useCellTextValues); + info.lastRow = util.num(r); }); From 14fd1d3375334aeaf6ad026104d4dc82d3bea6c8 Mon Sep 17 00:00:00 2001 From: Federico Sosa Date: Wed, 19 Apr 2017 12:02:32 -0300 Subject: [PATCH 2/4] Update spreadsheet.js --- lib/spreadsheet.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/spreadsheet.js b/lib/spreadsheet.js index 3c4057a..d5c15c2 100644 --- a/lib/spreadsheet.js +++ b/lib/spreadsheet.js @@ -512,6 +512,8 @@ Spreadsheet.prototype.receive = function(options, callback) { rows[r][c] = cellContent != '' ? cellContent : util.gcell2cell(cell, options.getValues, _this.opts.useCellTextValues); + console.log(rows[r][c]); + info.lastRow = util.num(r); }); From 8a64aebd70235f8c521b326b5b457c6a32c8348f Mon Sep 17 00:00:00 2001 From: Federico Sosa Date: Wed, 19 Apr 2017 12:11:41 -0300 Subject: [PATCH 3/4] Update spreadsheet.js --- lib/spreadsheet.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/spreadsheet.js b/lib/spreadsheet.js index d5c15c2..5b792a9 100644 --- a/lib/spreadsheet.js +++ b/lib/spreadsheet.js @@ -512,7 +512,8 @@ Spreadsheet.prototype.receive = function(options, callback) { rows[r][c] = cellContent != '' ? cellContent : util.gcell2cell(cell, options.getValues, _this.opts.useCellTextValues); - console.log(rows[r][c]); + console.log('test: ' + rows[r][c].toString()); + info.lastRow = util.num(r); }); From 1fd343379aaa9c6d8178aae45dd094e0b60ea97f Mon Sep 17 00:00:00 2001 From: Federico Sosa Date: Wed, 19 Apr 2017 12:15:27 -0300 Subject: [PATCH 4/4] Update spreadsheet.js --- lib/spreadsheet.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/spreadsheet.js b/lib/spreadsheet.js index 5b792a9..39d774d 100644 --- a/lib/spreadsheet.js +++ b/lib/spreadsheet.js @@ -512,8 +512,11 @@ Spreadsheet.prototype.receive = function(options, callback) { rows[r][c] = cellContent != '' ? cellContent : util.gcell2cell(cell, options.getValues, _this.opts.useCellTextValues); - console.log('test: ' + rows[r][c].toString()); + //console.log('test: ' + rows[r][c].toString()); + if (rows[r][c].toString().charAt(0) == '=') { + rows[r][c] = 0; + } info.lastRow = util.num(r); });