I happened to read the wonderful book "Pi and the AGM" written by Borwein brothers several months ago, and I wondered how they proved the famous formula
$$\frac{1}{\pi}=\frac{2\sqrt{2}}{9801}\cdots$$
After reading their proof, I realized that the theory of special value of modular forms is closely related to your question.
$$8\left(\frac{\eta(2\tau)}{\eta({\tau})}\right)^{12}$$ appears in the formula given by Ramanujan. I hear that H.M M.Weber Weber computed some special values of this modular form with Kronecker limit formula, where some EinsenteinEisenstein series appears in the formulait. Proper linear combination(which is closely related to the ideal class of some imaginary quadratic field) of EisenteinEisenstein series will give logarithmic of the modular form on the RHS, while the linear combination itself is a Hecke L-function which can be decomposed to the product of Dirichlet L-functions. Then the fundamental unit naturally appears in the Dirichlet class number formula.
More details can be found in the book of C.L.Siegel(Chapter II).