diff options
Autocommit at 28.05.2022 @ 18:24
1 files changed, 10 insertions, 1 deletions
| -rw-r--r-- | src/Models/Table.cpp | 11 |
diff --git a/src/Models/Table.cpp b/src/Models/Table.cpp index 602b424..bcaffb7 100644 --- a/src/Models/Table.cpp +++ b/src/Models/Table.cpp @@ -11,11 +11,20 @@ Table::Table(unsigned rows, unsigned cols) { cells[i] = List<Cell*>(cols); } + +bool containsNumber(const char*& str) { + while (*str == ' ') str++; + return ((*str == '+' || *str == '-') && (*(str + 1) >= '0' && *(str + 1) <= '9')) || + (*str >= '0' && *str <= '9'); +} + void Table::putCell(unsigned row, unsigned col, const char* rawValue) { unsigned intParse = atoi(rawValue); unsigned doubleParse = atof(rawValue); Cell* newCell; - if (doubleParse - intParse > 0.00001) + if (doubleParse - intParse > 0.00001 && doublePrase > 0.00001) newCell = new CellDouble(doubleParse); + else if (intParse ) + newCell = } |
