diff options
Autocommit at 29.05.2022 @ 13:09
1 files changed, 3 insertions, 2 deletions
| -rw-r--r-- | src/Models/Table.cpp | 5 |
diff --git a/src/Models/Table.cpp b/src/Models/Table.cpp index afb77b1..132559f 100644 --- a/src/Models/Table.cpp +++ b/src/Models/Table.cpp @@ -31,9 +31,10 @@ void Table::putCell(unsigned row, unsigned col, const char* rawValue) { if (containsNumber(rawValue)) { double doubleParse = atof(rawValue); + unsigned intPart = abs(doubleParse); - newCell = (abs(doubleParse) - (unsigned)(abs(doubleParse)) > 0.00001) - ? (Cell*)new CellDouble(doubleParse) : (Cell*)new CellInt(intParse); + newCell = (abs(doubleParse) - intPart > 0.00001) + ? (Cell*)new CellDouble(doubleParse) : (Cell*)new CellInt(intPart); } else { newCell = (*rawValue == '=') |
