Keeping track of the units as you go through this calculation will guarantee that you get it right.
Note that after the first value, each remaining number is just a conversion factor, selected to change the units from kg and
Once the units work out the way you need them to, the number s will as well. In the end you get $2661 g per gallon.