#include #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; // Define some context for the expression uc.DefineVariable("price = 49.99"); uc.DefineVariable("quantity = 3"); uc.DefineConstant("TAX_RATE = 0.0825"); // Define a format for currency output uc.Format("DataType: Double, Def: result = '$' + result"); // Expression to calculate total price, using variables auto expression = "price * quantity * (1 + TAX_RATE)"; // Evaluate with formatting enabled cout << "Formatted Total: " << uc.EvalStr(expression, true) << endl; // Evaluate with formatting disabled cout << "Raw Total: " << uc.EvalStr(expression, false) << endl; }