return tax rate based on annual income
npm install australian-tax-rate
var taxRate = require('australian-tax-rate');
//...
var pay = gross*(1 - taxRate(gross));
This is what ATO says about personal tax:
Taxable income | Tax on this income |
---|---|
0 – $18,200 | Nil |
$18,201 – $37,000 | 19c for each $1 over $18,200 |
$37,001 – $80,000 | $3,572 plus 32.5c for each $1 over $37,000 |
$80,001 – $180,000 | $17,547 plus 37c for each $1 over $80,000 |
$180,001 and over | $54,547 plus 45c for each $1 over $180,000 |
Above as graphs: