I switched companies last year and the offer letter quoted my salary as an annual gross number. The recruiter was confident, the email looked clean, and yet I still wanted to know one thing my brain refuses to compute on the fly: "how much per hour is that, really?" I ended up writing a tiny script to do it for me, and then kept extending it until I had a small toolkit for reasoning about my own pay. Sharing the bits I now keep in a paycheck.ts file in case anyone else finds it useful. The naive conversion The number every salary site quotes is annual gross divided by 2,080. Forty hours times fifty-two weeks. As code: function grossHourly ( annual ) { return annual / 2080 ; } grossHourly ( 95000 ); // 45.67 Enter fullscreen mode Exit fullscreen mode Fine for a back-of-the-envelope. But anyone who has actually filled out a timesheet knows that 2,080 is a fiction. You probably take vacation, you have public holidays, and you almost certainly do not bill for sick days.…