Aligntment of Text/number

what would be the easiest way to align something like the following:
TOTALS
Total Payroll: 750.00
Number of Checks: 2
Average Paycheck: 375.00
Total SS withheld: 60.00
Total Withholding: 75.00
setw?
[264 byte] By [mus2002stang] at [2007-11-20 10:55:11]
# 1 Re: Aligntment of Text/number
like this

TOTALS

Total Payroll: 750.00
Number of Checks: 2
Average Paycheck: 375.00

Total SS withheld: 60.00
Total Withholding: 75.00
mus2002stang at 2007-11-9 1:24:42 >
# 2 Re: Aligntment of Text/number
sry it wont line up in the box .. but im looking to line up all the right hand sides of the ends of the number
mus2002stang at 2007-11-9 1:25:49 >
# 3 Re: Aligntment of Text/number
Depends how you're outputting it.
GCDEF at 2007-11-9 1:26:47 >
# 4 Re: Aligntment of Text/number
sry it wont line up in the box .Put it in [code] tags.

Yes, setw in combination with left/right is the right way to lign up: cout << fixed; // no scientific output
cout << setw(40) << left << "Total Payroll:" << setw(10) << right << setprecision(2) << 750.0 << "\n";
cout << setw(40) << left << "Number of Checks:" << setw(10) << right << 2 << "\n";
cout << setw(40) << left << "Average Paycheck:" << setw(10) << right << 375.0 << "\n";will output 12345678901234567890123456789012345678901234567890
Total Payroll: 750.00
Number of Checks: 2
Average Paycheck: 375.00
treuss at 2007-11-9 1:27:45 >