Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models / Table.cpp
diff options
context:
space:
mode:
Commitd2cdb5796067925ef58cba9e38976792b26a2fc5 (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-05-29 13:09:42 +0300
Committer
 Syndamia <kamen@syndamia.com>
2022-05-29 13:09:42 +0300
Files2c1643360235055ff0f41a744c6c72c3e9965a8b /src/Models/Table.cpp
FMI-OOP-P2_Tables-d2cdb5796067925ef58cba9e38976792b26a2fc5.tar
FMI-OOP-P2_Tables-d2cdb5796067925ef58cba9e38976792b26a2fc5.tar.gz
FMI-OOP-P2_Tables-d2cdb5796067925ef58cba9e38976792b26a2fc5.zip
Parent83a4f8032fbdad2ea35ef101dfb14433f672b6d9 (diff)
Autocommit at 29.05.2022 @ 13:09
1 files changed, 3 insertions, 2 deletions
-rw-r--r--src/Models/Table.cpp5
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 == '=')