#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   // Rule 1: Format Doubles as currency with two decimal places.
   auto doubleType = uc.DataTypeOf(BuiltInType::Float_Double);
   uc.Format("Result = '$' + Format('{:.2f}', double(Result))", doubleType);

   // Rule 2: Center-align strings in a 15-character field padded with '-'.
   auto strType = uc.DataTypeOf(BuiltInType::String);
   uc.Format("Result = Format('{:-^15}', Result)", strType);

   cout << "Price: " << uc.EvalStr("199.999") << endl;
   cout << "Discount: " << uc.EvalStr("7.5") << endl;
   cout << "Label: " << uc.EvalStr("'Summary'") << endl;
}