The average coordination number in a fluid is defined as the average number of first neighbors around a given molecule. Therefore, we must integrate the average density around a molecule over a spherical shell corresponding to a reasonable geometric definition of first neighbors in a disordered system.
For a one-component fluid, the radial distribution function (RDF) $g(r)$ is related to the average radial density $n(r)$ around a particle at the origin by the formula
$$
n(r) = \rho g(r) ,
$$
where $\rho$ is the average number of particles in the fluid. Therefore, the average number of particles is a spherical shell between radii $r_1$ and $r_2$ is given by
$$
CN = 4 \pi \int_{r_1}^{r_2} r^2 n(r) dr.
$$
A reasonable choice for the integration limits is $r_1=0$ and $r_2$ at the first minimum of $r^2 n(r)$, although other alternatives may be used.
Notice that the previous equations refer to a one-0componet fluid. In the case of an ionic solution, they require the generalization to a multi-component system. This involves the introduction of the partial RDFs ($g_{ij}(r)$) distinguishing the species $i$ and $j$ of the two molecules of the pair and the average number densities of each species $\rho_i$. Therefore, the formula for the average coordination number of particles of species $j$ around a particle of species $i$ becomes
$$
CN_{ij} = 4 \pi \rho_j \int_{r_1}^{r_2} r^2 g_{ij}(r) dr.
$$
with $r_1$ and $r_2$ depending on the pair $ij$.