1
0
Fork 0

Spreadsheet standardDeviation fix.

pull/1/head
selim 2023-12-26 18:15:27 +01:00
parent dd9ff48a4e
commit 6e59545dc1
1 changed files with 4 additions and 4 deletions

View File

@ -293,13 +293,13 @@ public class Spreadsheet {
double avg = 0; double avg = 0;
int counter = 0; int counter = 0;
for(int r = getRow(startCellName); r<getRow(endCellName); r++) for(int r = getRow(startCellName); r<getRow(endCellName)+1; r++)
for(int c = getCol(startCellName); c<getCol(endCellName); c++) for(int c = getCol(startCellName); c<getCol(endCellName)+1; c++)
if(!(cells[r][c].isEmpty())) { try {
avg += Double.parseDouble(cells[r][c].getValue()); avg += Double.parseDouble(cells[r][c].getValue());
counter++; counter++;
cellNames.add(getCellName(r, c)); cellNames.add(getCellName(r, c));
} } catch (NumberFormatException | ArrayIndexOutOfBoundsException a ){}
avg /= counter; avg /= counter;
//average/ add cell names to list //average/ add cell names to list
System.out.println(cellNames); System.out.println(cellNames);