I am trying to find a way to easily compute localisations of the ring $\mathbb{Z}/n\mathbb{Z}$ ($n>1$). Is there any general result for this? I found here that when the multiplicative subset is $S=\{1,b,b^2,\dots\}$ and the prime factorization of $n$ is $n = \prod p_i^{l_i}$ then $$S^{−1}(\mathbb{Z}/n\mathbb{Z}) \cong \prod_{p_i \nmid b} \mathbb{Z}/p_i^{l_i}\mathbb{Z}$$
Does this formula somehow generalize to an arbitrary multiplicative subset $S \subset \mathbb{Z}/n\mathbb{Z}$?