using uCalcSoftware; var uc = new uCalc(); var t = new uCalc.Transformer(); // Rule to find quantity and price, then calculate total. // Note the explicit Double() conversion for the captured text variables. t.FromTo("Qty: {@Number:qty}, Price: {@Number:price}", "{@Self}, Total: {@Eval: Double(qty) * Double(price)}"); var invoice = """ Item: Book, Qty: 3, Price: 15.00 Item: Pen, Qty: 10, Price: 1.50 """; Console.WriteLine(t.Transform(invoice));