First convert 40 grams to kg. A kilogram is 1000 grams, so you divide 40 by 1000 which is .04 kg.
40 grams * 1 kg / 1000 grams = .04 kg
Then you simply multiply the price per kg by the number of kg giving 6.6.
,04 kg * 165 / 1 kg = 6.6