Skip to content

PayPeriodsPerYear

This property numerically defines the pay period to be used in calculations. This value defaults to 12, which corresponds to a monthly pay period. The Earnings property and the TaxAmount method are expressed in terms of this same pay period.

For example, suppose we have

// using TaxControls;
try {
CTaxControl tc = new CTaxControl();
tc.DataFilename = "us.dat";
tc.SelectedTax = "fit";
// 12 for monthly:
tc.PayPeriodsPerYear = 12;
tc.Earnings = 1000.00;
Console.WriteLine(jc.TaxAmount());
} catch (TaxControlException e) {
Console.WriteLine(e.Message);
}

giving a TaxAmount of $150. The Earnings and TaxAmount are both considered monthly figures.

If we were to change PayPeriodsPerYear to 24:

// using TaxControls;
try {
TaxControl tc = new TaxControl();
tc.setDataFilename("us.dat");
tc.setSelectedTax("fit");
// now 24 for semi-monthly:
tc.setPayPeriodsPerYear(24);
tc.setEarnings(1000.00);
Console.WriteLine(jc.TaxAmount());
} catch (TaxControlException e) {
Console.WriteLine(e.Message);
}

the $1000 Earnings value would now correspond to a semi-monthly figure, and TaxAmount would produce a new semi-monthly tax figure, in all likelihood not $150. (This is because many taxes are based on brackets which determine the tax rate.)