Use this macro to tell
that you don’t want your units slanted in math mode.
\newcommand{\unit}[1]{\ensuremath{\, \mathrm{#1}}}
$ m = 5 kg $ will render as “m = 5 kg”.$ m = 5 \unit{kg} $ will render as “m = 5 kg”.Use the units.sty package if my macro is not enough for you.