Invoice and Numeric Formatting
C# composite formatting makes console reports readable without manual padding.
How it works
Format aligned currency output with interpolation.
Alignment components set field widths and the C format specifier uses the current culture's currency format.
Runnable C# example
Program.cs
using System;
class Program
{
static void Main()
{
var lines = new[] { ("Book", 2, 12.50m), ("Pen", 3, 1.25m) };
foreach (var (name, quantity, price) in lines)
Console.WriteLine($"{name,-8} {quantity,2} {quantity * price,8:F2}");
}
}
Book 2 25.00
Pen 3 3.75Practice with the debugger
Set a breakpoint on an important assignment or condition, click Debug, and inspect the local values before stepping to the next line.