From d2cdb5796067925ef58cba9e38976792b26a2fc5 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 29 May 2022 13:09:42 +0300 Subject: Autocommit at 29.05.2022 @ 13:09 --- src/Models/Table.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Models/Table.cpp') 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 == '=') -- cgit v1.3.1-23-gd82d