public String format(int row, int col) {
// row and column headers are strings
if (row == 0) return getColName(col);
if (col == 0) return getRowName(row);
SimpleData d = getData(row, col);
if (d == null || !d.isDefined()) return "";
String result = d.format();
if (result.startsWith("#") || result.startsWith("ERR")) return result;
int fmt = useRowFormats ? row : col;
return prefix[fmt] + result + suffix[fmt];
}