I built a pay raise calculator because I got a raise, multiplied my salary by 1.05, and then watched my actual paycheck go up by a lot less than I expected. The gap between "5% raise" and "the extra money that shows up" turned out to be wide enough that I wanted to understand it properly — and once I started writing the code, "what's my raise worth?" split into three completely different questions.
This is a write-up of the small TypeScript engine behind it, and the three gotchas that made the math less obvious than salary * 1.05.
Question 1: the gross number (the easy one)
This is the only part that is salary * 1.05:
const newSalary = currentSalary * (1 + raisePct / 100);







