Switching majors at a critical stage
Change-of-interest among mathematicians is more common than many would have imagined. Reasons vary, some decided to do something more applied, some decided to work in the industry for the better pay, some decided to work in a more dynamic environment than the academia...

I can assure you that the time you spent on mathematics is time well spent for your intellectual development and that your advanced math training will be a valuable asset wherever you go. Even though you may not be solving abstract algebra or real analysis problems for your future career, it's the analytical skills that you're equipped with that will make a difference between you and other candidates. Mathematicians, if well trained, develop unique insights to problems and are often highly detail-oriented.

If you want to switch to computer science, there are a number of Masters Programs in computer science that will accept non-CS majors. In fact, if you have taken sufficiently many advanced courses in computer science, you may apply to grad school in computer science right away without going through the (often exorbitantly costly) masters program. Many of my classmates have done that and successfully transitioned into computer science.

Last but not least, speak to your academic advisor and discuss your situation.

Good luck!