I've found two methods to convert from $ppm$ to $g/m^3$. They both appear to give equivalent results, but I don't understand why. Can anyone join the dots for me and explain why they are equivalent methods, or show a derivation for Method 1? I've found a derivation for Method 2.
Method 1 - Definition
$$C[g/m^3] = \frac{C[ppm] \cdot \rho}{1000}$$
Where $C[ppm]$ and $C[g/m^3]$ represent gas concentration in units of $ppm$ and $g/m^3$ respectively and $\rho$ represents gas density.
Method 2 - Definition (As derived here)
$$C[g/m^3] = \frac{C[ppm] \cdot M \cdot P}{R \cdot T \cdot 10^6}$$
Where $M$, $P$, $R$ and $T$ represent molar mass, pressure, ideal gas constant and temperature respectively.
Method 1 - Example - Carbon Monoxide (CO)
Assuming $C[ppm]$ as $100ppm$ and CO density as $1.15 kg/m^3$ at $20^{\circ}C$ and $100000Pa$ $$C[g/m^3] = \frac{C[ppm] \cdot \rho}{1000}$$ $$C[g/m^3] = \frac{100 \cdot 1.15}{1000}$$ $$C[g/m^3] = 0.115$$
Method 2 - Example - Carbon Monoxide (CO)
Assuming $C[ppm]$ as $100ppm$ at $20^{\circ}C$ and $100000Pa$.
$$C[g/m^3] = \frac{C[ppm] \cdot M \cdot P}{R \cdot T \cdot 10^6}$$ $$C[g/m^3] = \frac{100 \cdot 28 \cdot 100000}{8.3145 \cdot (20+273.15) \cdot 10^6}$$ $$C[g/m^3] = 0.115$$