A traditional way of assessing the size of a subset X of the integers is to use some version of density. An alternative approach, independently rediscovered by many authors, is to look at the closure of X in the profinite completion of the integers. This for example gives a quick, intuitive solution to questions like: what is the probability that an integer is square-free? Moreover, in many cases, one finds that the density of X can be recovered as the Haar measure of the closure of X. I will discuss some things that one can learn from this approach in the more general setting of rings of integers in global fields. This is joint work with Luca Demangos.