This is a basic exponent rule.
[tex]\frac{1}{x} = x^{-1}[/tex]
So,
[tex]\frac{g}{L} = g \frac{1}{L} = g L^{-1}[/tex]
Additionaly, recall that
[tex]\frac{a}{\frac{b}{c}} = \frac{ac}{b}[/tex]
If you are using software, it is possible that it can't equate kg to g, which means you have to convert g/L to kg/L.