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