From 9e7af3dd34b747c44aeb2b29fcef7531dc83b17b Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 28 May 2022 18:24:25 +0300 Subject: Autocommit at 28.05.2022 @ 18:24 --- src/Models/Table.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/Models/Table.cpp') 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(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 = } -- cgit v1.3.1-23-gd82d