public override string ToString() { string receipt = ""; foreach (var p in ProductList) { receipt += (p.ToString() + "\n"); } receipt += "Sales Taxes:" + TotalSalesTax.ToString("F") + "\n"; receipt += "Total:" + TotalAmount + "\n"; return(receipt); }
public string Output() { var sb = new StringBuilder(); foreach (var item in Receipt) { sb.AppendLine(item.Output); } // tax and total sb.AppendLine("Sales Taxes: " + TotalSalesTax.ToString("0.00")); sb.AppendLine("Total: " + TotalPrice.ToString("0.00")); return(sb.ToString()); }