The formal degree is a fundamental invariant of a discrete series representation which generalizes the notion of dimension from finite dimensional representations. For discrete series with unipotent cuspidal support, a formula for formal degrees, conjectured by Hiraga-Ichino-Ikeda, was verified by Opdam (2015). For split exceptional groups, this formula was previously known from the work of Reeder (2000). I will present a different interpretation of the formal degrees of unipotent discrete series in terms of the nonabelian Fourier transform (introduced by Lusztig in the character theory of finite groups of Lie type) and certain invariants arising in the elliptic theory of the affine Weyl group. This interpretation relates to recent conjectures of Lusztig about `almost characters' of p-adic groups. The talk is based on joint work with Eric Opdam.