keeping in mind that there are 1000 grams in a KILOgram and that in 1 meter there are 100 cm, therefore in 1 m³, there are (100 cm)³, or 100³ cm³, then
[tex]\bf \cfrac{170~\underline{kg}}{\underline{m^3}}\cdot \cfrac{1000~g}{\underline{kg}}\cdot \cfrac{\underline{m^3}}{100^3~cm^3}\implies \cfrac{170\cdot 1000~g}{100^3~cm^3}\implies \cfrac{170\cdot 1000~g}{1000000~cm^3}
\\\\\\
\cfrac{170\cdot 1~g}{1000~cm^3}\implies \cfrac{170~g}{1000~cm^3}\implies \cfrac{17~g}{100~cm^3}\implies 0.17\frac{g}{cm^3}[/tex]