Spreadsheet standardDeviation fix.
parent
dd9ff48a4e
commit
6e59545dc1
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue