Here's and example of what I have which italicizes everything:
\begin{equation}
\lambda = c/f = (3x10^8~m/s)/2x10^8~Hz = 1.5~m
\end{equation}
Here's and example of what I have which italicizes everything:
\begin{equation}
\lambda = c/f = (3x10^8~m/s)/2x10^8~Hz = 1.5~m
\end{equation}
Here's one solution:
\newcommand{\amt}[2]{\ensuremath{#1\,\mathrm{#2}}}
which is used like \amt{9.80}{m/s^2} and can be used in either text or math mode.
You can also take a look at the siunitx package.
siunitxpackage, which is for formatting numbers with and without units, see e.g. https://tex.stackexchange.com/questions/2248/what-package-should-i-use-to-typeset-units/2254#2254 – Torbjørn T. Jul 12 '20 at 19:48