tl;dr– The alleged-excerpt's wrong. It's combining several different problems, including messed-up unit-logic and a dated unit-convention.
Two conventions: Normal math and old-fashion Chemistry-math.
There're two relevant conventions here:
Normal math, that everyone uses for everything.
Old-fashioned silliness.
The book's referring to Convention-(2). So, let's look at the right way to do this, then we can try to untangle the book's distorted logic.
1: Using normal math.
If you want an amount-of-molecules, $n ,$ then:
Let people plug in whatever value they want, using whatever units they want.
Let people do their own unit-conversions if they want to.
To fix the textbook's mistakes:
The particle-density is $n/V$, where $n$ is the amount of particles in the container of volume $V .$
Example calculations:
$$
{\newcommand{\Row}[3]{ #1 & #2 & #3 & \frac{#2}{#3} \\ \hline }}
{\newcommand{\Sci}[2]{ #1 \cdot {10}^{#2} }}
{\newcommand{\Stack}[2]{ {\small \begin{array}{c} #1 \\[-25px] #2 \end{array}} }}
\begin{array}{|c|c|c|} \hline
\Row{i}{n}{V}
\Row{1}{\Sci{2.429}{25} \,\text{particles}}{1\,\rm{m}^3}
\Row{2}{\Sci{1.2147}{25} \, \Stack{\text{pairs of}}{\text{particles}} }{1\,\rm{m}^3}
\Row{3}{\Sci{2.0244}{24} \, \Stack{\text{dozens of}}{\text{particles}} }{1\,\rm{m}^3}
\Row{4}{\Sci{1.8687}{24} \, \Stack{\text{baker's dozens}}{\text{of particles}}}{1\,\rm{m}^3}
\Row{5}{40.34 \, \Stack{\text{moles of}}{\text{particles}} }{1\,\rm{m}^3}
\end{array}
$$
Then if you don't like the units of $\frac{n}{V} ,$ you could just do whatever unit-conversions you'd like to arrive at whatever units you'd like.
2: Old-fashioned silliness.
Apparently some folks used to think that units were too complicated, so they sought to simplify things by embedding units into equations.
The rules weren't entirely consistent, but the logic went sort of like this:
Everyone in a field adopts a standard unit-set and agrees to always use the same units.
All variables in all expressions are assumed to be unitless, simply being the number from the value when written in the expected units.
Any unit-conversion-factors needed to make this work are embedded in equations.
So instead of the simple, straight-forward math in the last section, your textbook apparently wrote:
The number density of particles is $nN/V$, where $n$ is the total amount of molecules in the container of volume $V$ and $N$ is Avogadro's constant.
, reasoning:
The "the total amount of molecules" is an amount, which is always in units of moles, per the field's convention. So, $n$ is expected to be a unitless number.
They can't call the amount of molecules the "amount of molecules" when they don't want moles because they're requiring that amounts always be in moles. So they choose the word "number", which is the amount of molecules that's an exception to the use-only-moles rule.
- To be clear: The unit of "moles" is a number, like "dozen" or "thousand", so an "amount of molecules" and a "number of molecules" are logically equivalent in this context, except in that they're implying that the latter is an exception to the rule that all amounts are in units of moles.
Since they've stripped out all of the units and are requiring specific units to be assumed, they need to embed conversion-factors. In this case, that's Avogadro's constant, $N_{\text{Avogadro}} .$
Apparently they don't like writing it as $`` N_{\text{Avogadro}} "$ or even just $`` N_{\text{A}} " ,$ so they write it as $`` N " .$ Given that their primarily use-case for Avogadro's constant is to multiply it by a variable they're calling $`` n " ,$ that seems like a weird choice.
Okay, so that might all sound like a lot of needless silliness, but it's actually even worse in practice. Because in practice, when folks do a lot of science/engineering/medicine/etc. in real-life, we tend to combine stuff from across fields – so it's not just obnoxious, but stuff can get mixed up.
For example, in 1999, it was reported that the Mars-Climate-Orbiter crashed because two different groups were using implicit-units like this, with an error, causing a huge loss.
And that's the funny sort of problem. Not that it's funny when missions-to-Mars needlessly crash, wasting a small fortune and setting back scientific progress, but at least we're not talking about dosing mistakes hospitals.
Then there's silly stuff, too. For example, I've seen equations that involved terms like $`` {\left(T-273\right)}^{2} " ,$ where $`` T "$ was meant to be in terms of $\mathrm{K} .$ My guess was that the equation was originally written in terms of $\sideset{^\circ}{}{\mathrm{C}}$ and that someone later switched it to $\mathrm{K} .$ But did the data they give come from before-or-after the conversion? Or maybe the data was after the conversion, but whoever did the calculations used the full $-273.15 \,?$ It's not fun having to guess stuff like that when small errors matter.
All of that said... technically,
The number density of particles is $nN/V$, where $n$ is the total amount of molecules in the container of volume $V$ and $N$ is Avogadro's constant.
could be used if correctly navigated:
You start off with the number of particles in terms of moles.
You want the particle-density not in terms of moles.
You could calculate $\frac{n \times {N}_{\text{Avogadro}}}{V}$ to do that.
It's an incredibly silly, error-prone, convoluted approach to doing something that would otherwise be relatively very simple, but it's not technically wrong aside from those issues.
Conclusion.
The textbook's in error. The correct approach would be to just calculate $\frac{n}{V} ,$ then do whatever unit-conversions you'd want.
Technically if you follow their logic far enough it can work when appropriately handled, but it's just too absurd to take seriously.