Created
June 10, 2022 05:45
-
-
Save thinkier/3abe9eeecfe8c4665c6c5fef7abfbf86 to your computer and use it in GitHub Desktop.
Australian Marginal Income Tax calculator (dumps to csv)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const brackets: Array<[number, number]> = [ | |
[ 0, 0], | |
[ 18200, 19], | |
[ 45000, 32.5], | |
[ 120000, 37], | |
[ 180000, 45] | |
]; | |
console.log("Income", "Tax"); | |
for(let amt = 0; amt <= 1000000; amt++) { | |
let taxed = 0; | |
let aft = 0; | |
for(let bracket of brackets) { | |
let [min, tax] = bracket; | |
if (amt < min) break; | |
aft += (amt - min) * (tax - taxed) / 1e2; | |
taxed = tax; | |
} | |
console.log(`${amt},${aft.toFixed(2)}`); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment