To convert grams to kilograms divide by 1000. I've generated some hopefully helpful examples randomly below, as with most random sentences please excuse the repetitive and occasionally comic outcomes.

You've got 9.7 grams of diamonds but someone only wants to buy that in units of kilograms, to change the units divide by 1000. Now you have 0.0097 kilograms.

How many kilograms of emeralds are there in 5.8 grams? Just divide by 1000 to get the answer of 0.0058 kilograms.

You have 8.1 grams of ruby's but you need to know how many kilograms that is. To get the answer divide by 1000 which gives you 0.0081 kilograms.

In 8.7 grams of gold there are 0.0087 kilograms, to achieve this take 8.7 and just divide by 1000.