Just buy a few feet, more than you think you may need, and cut to exact length as you route the housing along the handlebars for a custom fit.
Also, depending on the size of your frame, you may a need longer rear derailler cable for this set up. I've always used tandem cables for this.