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
(Note here that 1 kg = 1000 grams meaning that 1 kg / 1000 grams = 1; anything divided by itself is one; therefore, when I multiply by 1 kg / 1000 grams I’m not changing the value, only the units.)
Then you simply multiply the price per kg by the number of kg giving 6.6.
.04 kg * 165 / 1 kg = 6.6
(Oranges are different. You can’t compare apples to oranges.)