in Code

New salary calculator features

I’ve spent a bit of time over the last few weeks cleaning up the salary calculator, making sure the calculations are as accurate as possible across many, many, many different scenarios and adding a bunch of new features to it as well.

I think I’ve tested all of the new features pretty extensively and it all seems to work as planned but if you do find any bugs or problems with the calculations, please let me know.

Here’s what’s changed in the calculator recently:

  • Added a salary checker. Now you can enter your job title into the salary checker and it will tell you the average salary for that job so you can compare and make sure you’re being paid the going rate.
  • Added a colleague salary calculator. If you have a colleague who has a student loan for a course started before 1st September 2012, you can ask them their loan repayment amount, and the colleague salary calculator will reverse engineer it to tell you their salary.
  • Added Plan 2 student loan option. Any student starting a course after 1st September 2012 doesn’t pay back their loan until they salary is more than £21,000. The rate is still 9%, the same as Plan 1, but this higher threshold means the repayment is less and the loan will last longer.
  • Ability to have two types of student loan. Some people will have started a course before 1st September 2012 and also a course after 1st September 2012, which means they have two student loans. The calculator will now let you know exactly how much you pay across both loans each month.
  • Two new pension options. You can now choose between an employer’s pension, salary sacrifice or a private pension plan. This was the most painstaking of all the updates and took a lot of time to get my head around the different tax relief options for each pension for those who have higher and additional income tax rates.
  • Display a chart for the last 6 years. There’s now a handy chart which shows how much your salary has changed over the last 6 years. I’ll be adding student loans, pensions etc to this shortly as well.
  • You can now choose days and hours per week. Previously, the calculator assumed 5 days a week and 37.5 hours a week. Now you can specify how many days or hours you work and these will be used instead of the defaults.
  • Options for overtime. There are now two fields for you to enter how many hours of overtime you do each money and the rate at which you’re paid for it. The default rates are 1.5 and 2x your hourly salary but you can specify whatever your actual rate is.
  • More display options in the results table. Previously you had a display of year, month, week and day only in the results. Now there is a dropdown option where you can choose between weekly, 2-weekly or 4-weekly in one column and daily or hourly in the other column.
  • Simple or advanced mode. The calculator options was getting overwhelming, so I hid some options by default for those who just want a simple calculation. The advanced button will show the extra options and if it’s advanced is chosen when you click calculate, it will remain open.
  • Added tooltips. With the extra options, I thought it best to add some tooltips to explain each in case it wasn’t obvious right away what each option was for.
  • Fixed some bugs. There were a couple of minor calculation bugs that I’ve fixed to make sure the calculator is as accurate as possible.
  • Front end validation. The calculator now validates each of the fields before submission to make sure they are correct and displays an error message if not. This includes quite a complicated regex for tax codes which was enjoyable!
  • Back end validation. I’ve beefed up the back end validation to make sure all inputs are sanitized before being sent into the calculator. This should hopefully prevent errors if you don’t have JavaScript enabled for some reason.

Please give it a try, try and break it if you can, so I can improve it as much as possible.

If you have a feature request or idea for something I could do, I’d love to hear it!