Let $K$ be a totally real number field of degree $n$. We show that the number of totally positive integers (or more generally the number of totally positive elements of a given fractional ideal) of given trace is evenly distributed around its expected value, which is obtained from geometric considerations. This result depends on unfolding an integral over a compact torus.