I have a DisplayResults method and when it's called it outputs its contents to the console. I'm having difficulty getting it to align well. I have used tabs \t to align it but it could look better. Here is the code:
public static void DisplayResults(string empName, decimal empWeeklySales, decimal COMMISSION_RATE, decimal grossPay,
decimal INCOME_TAX_RATE, decimal incomeTaxPayable, decimal PRSI_RATE, decimal prsiPayable,
decimal RETIREMENT_CONTRIBUTION_RATE, decimal retirementContribution,
decimal totalDeductions, decimal takeHomePay)
{
Console.WriteLine("\n*************** WEEKLY PAYROLL APP ***************\n");
Console.WriteLine("Employee Name: \t\t\t\t{0}\n", empName);
Console.WriteLine("This week's sales: \t\t\t{0:n}", empWeeklySales);
Console.WriteLine("Commission Rate: \t{0:F2}%\n", COMMISSION_RATE);
Console.WriteLine("Gross Pay: \t\t\t\t{0:F2}", grossPay);
Console.WriteLine("Income Tax: \t\t({0:F2}%) \t{1:F2}", INCOME_TAX_RATE, incomeTaxPayable);
Console.WriteLine("PRSI: \t\t\t({0:F2}%) \t{1:F2}", PRSI_RATE, prsiPayable);
Console.WriteLine("Retirement Contribution: ({0:F2}%) \t{1:F2}", RETIREMENT_CONTRIBUTION_RATE, retirementContribution);
Console.WriteLine("Total Deductions: \t\t\t{0:F2}\n", totalDeductions);
Console.WriteLine("Take Home Pay: \t\t\t\t{0:F2}\n", takeHomePay);
Console.WriteLine("\n**************************************************");
}
When I output it, it looks like this:
As you can see, it doesn't line up very well. I would like the percent values in the middle and the money values to the right, to both be right-aligned. So, ideally the text would all be left aligned, the middle area with the percent values right-aligned and an outer area of money values to the right to be right-aligned. I hope this makes sense. Can anyone advise me on how best to achieve this? Thank you.