return null on getString() for NaN values

This commit is contained in:
Ben Fry
2014-07-30 09:38:19 -04:00
parent cf4e7a7c46
commit a0bc02db16
2 changed files with 16 additions and 4 deletions

View File

@@ -2984,11 +2984,19 @@ public class Table {
return missingString;
}
return columnCategories[column].key(cat);
} else {
return String.valueOf(Array.get(columns[column], row));
} else if (columnTypes[column] == FLOAT) {
if (Float.isNaN(getFloat(row, column))) {
return null;
}
} else if (columnTypes[column] == DOUBLE) {
if (Double.isNaN(getFloat(row, column))) {
return null;
}
}
return String.valueOf(Array.get(columns[column], row));
}
/**
* @param columnName title of the column to reference
*/
@@ -3443,9 +3451,9 @@ public class Table {
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
public void replaceAll(String orig, String replacement) {
public void replaceAll(String regex, String replacement) {
for (int col = 0; col < columns.length; col++) {
replaceAll(orig, replacement, col);
replaceAll(regex, replacement, col);
}
}

View File

@@ -1,6 +1,10 @@
0229 core (3.0a2)
X add copy() method to Table
_ need a better method for "missing" data in Table
_ if missing int is zero, can't just remove those values from saving a table
_ but for NaN values, it's a necessity
pulls
X implement A and a (elliptical arcs)