\documentclass{article}
\usepackage{nicefrac,units}
\begin{document}

\section{Examples}
\sffamily\bfseries\unit{m}

\sffamily\bfseries$\unit{m}$

\sffamily\bfseries\unit[1]{m}

\sffamily\bfseries$\unit[1]{m}$

\sffamily\bfseries\unitfrac{m}{s}

\sffamily\bfseries$\unitfrac{m}{s}$

\sffamily\bfseries\unitfrac[1]{m}{s}

\sffamily\bfseries$\unitfrac[1]{m}{s}$


\scriptsize\sffamily\itshape\unitfrac[1]{m}{s}

\scriptsize\sffamily\itshape$\unitfrac[1]{m}{s}$


\bfseries\itshape\nicefrac{1}{2}

\bfseries\itshape$\nicefrac{1}{2}$

\nicefrac[\texttt]{1}{2}

$\nicefrac[\mathcal]{A}{B}$

\end{document}