We examine the integer discontinuity (or derivative discontinuity) of the exact energy functionals of Kohn-Sham density-functional theory for the spin-polarized case. The integer discontinuity and its cause, the piecewise linearity of the energy in the grand canonical ensemble, are required to improve the predictive power of density-functional approximations to the exchange-correlation energy. We show how any spin-polarized DFA can be adapted to display the proper integer discontinuity. The formalism we present here can be used to improve functionals further within spin density-functional theory and fragment-based formulations of DFT.