diff options
| Commit | 346dd895dfcf06857607516f90489aa12c8ce523 (patch) | |
|---|---|---|
| Author | 2022-05-29 09:14:13 +0300 | |
| Committer | 2022-05-29 09:14:13 +0300 | |
| Files | 9fe14e3aec6722f44aae885ee65574e6e79227eb /src | |
| FMI-OOP-P2_Tables-346dd895dfcf06857607516f90489aa12c8ce523.tar FMI-OOP-P2_Tables-346dd895dfcf06857607516f90489aa12c8ce523.tar.gz FMI-OOP-P2_Tables-346dd895dfcf06857607516f90489aa12c8ce523.zip | ||
| Parent | bbf74136641a70150fa8e09b69b99bbce99ffeaf (diff) | |
Autocommit at 29.05.2022 @ 09:14
2 files changed, 8 insertions, 2 deletions
| -rw-r--r-- | src/Models/CellFormula.cpp | 5 | ||||
| -rw-r--r-- | src/main.cpp | 5 |
diff --git a/src/Models/CellFormula.cpp b/src/Models/CellFormula.cpp index 4e84681..6090fd6 100644 --- a/src/Models/CellFormula.cpp +++ b/src/Models/CellFormula.cpp @@ -38,11 +38,16 @@ CellFormula::CellFormula(const char* str, const List<List<Cell*>>* tableCells) : parseAndSetValue(str); } +#include <iostream> + double CellFormula::getNumeralValue() { return calculate(); } String CellFormula::getValueForPrint() { + for (unsigned i = 0; i < formula.get_count(); i++) + std::cout << "[" << formula[i].left->getValueForPrint() << " " << (int)formula[i].right << std::endl; + return 90; return String() += calculate(); } diff --git a/src/main.cpp b/src/main.cpp index 9cff886..082cf03 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,8 +2,9 @@ int main() { Table table(5, 5); - table.putCell(0, 0, "Test"); - table.putCell(1, 0, "3"); + table.putCell(0, 0, "8"); + table.putCell(0, 1, "3"); + table.putCell(0, 2, "= 9 * 10"); UserInterface ui(&table); ui.run(); } |
