The study of the Berezinskii-Kosterlitz-Thouless transition in two-dimensional $|varphi|^4$ models can be performed in several representations, and the amplitude-phase (AP) Madelung parametrization is a natural way to study the contribution of density fluctuations to nonuniversal quantities. We introduce a functional renormalization group scheme in AP representation where amplitude fluctuations are integrated first to yield an effective sine-Gordon model with renormalized superfluid stiffness. By a mapping between the lattice XY and continuum $|varphi|^4$ models, our method applies to both on equal footing. Our approach correctly reproduces the existence of a line of fixed points and of universal thermodynamics and it allows to estimate universal and nonuniversal quantities of the two models, finding good agreement with available Monte Carlo results. The presented approach is flexible enough to treat parameter ranges of experimental relevance.