# Units Question for PlanetData[..]

Attached is a command, its output, and the issue I have now. This outputs g/cm^3, but I'd rather have the units in kg/m^3.

I guess I don't know how to handle the command which outputs all the data at once. How can the units be changed for this kind of output?

Thank you (again)

• For future reference, please add your code as text, and not as pictures, so we don't have to retype it ourselves. Jan 5 at 19:13

UnitConvert[
PlanetData[PlanetData[], "Density", "EntityAssociation"],
"Kilograms"/"Meters"^3
]


Of course I am sure you are aware that the two units result in the same numerical results, i.e. 1 g/cm^3 = 1 kg/m^3.

• Pipped me by 31 seconds :) Jan 5 at 19:12
• @CarlLange Great minds, and all that... :-) Jan 5 at 19:13
• @MarcoB --- Terrific.....I don't even understand the answer I got yesterday, but I will...and now THIS one. It's simple, and easy. I appreciate it! I hope I can understand and do this on my own.
– fiz
Jan 5 at 19:34
• Also, UnitConvert[PlanetData[PlanetData[], "Density", "EntityAssociation"], "SIBase"] Jan 5 at 19:56