using uCalcSoftware;

var uc = new uCalc();
// Rule 1: Format Doubles as currency with two decimal places.
var 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 '-'.
var strType = uc.DataTypeOf(BuiltInType.String);
uc.Format("Result = Format('{:-^15}', Result)", strType);

Console.WriteLine($"Price: {uc.EvalStr("199.999")}");
Console.WriteLine($"Discount: {uc.EvalStr("7.5")}");
Console.WriteLine($"Label: {uc.EvalStr("'Summary'")}");