I believe it is much cheaper to rent on the boat rather than from home for a week.
However, you can usually purchase a tuxedo for a little more than the cost of renting one. That is what I did, because we knew that we would take several cruises, and I didn't want to rent continually. So, I bought a used tux from a local rental shop. It was a great quality wool tux, barely worn.
You might check that, if you think you will be cruising more than once.