Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#8 sum() functino error

open
nobody
None
5
2011-05-24
2011-05-24
Anonymous
No

if you define a SUM() for some rows, and the first row doeasn't have a value, then the SUM() function behave something like a CONCATENATE function.
to reproduce the error just load this sheet:

dbCells = [
[0,0,"1st value",""], // A1

[0,1,"2nd value",""], // A2
[1,1,"123",""], // B2

[0,2,"3rd value",""], // A3
[1,2,"123",""], // B3

[0,3,"tot",""], // A4
[1,3,"=sum(B1:B3)",""], // B4
];

Discussion

  • Hello,

    you can edit "<sgs-dir>/bin/ext/lib/simple_spreadsheet/spreadsheet.js", replace:
    for (var i=0; i<arr.length; i++) result += arr[i];

    with:
    for (var i=0; i<arr.length; i++) result += arr[i]*1;

    bye
    Thomas