Decimal exponents numbers

scientific notationsiunitx

In chemistry, one often has to use decimal exponents: 10^{-4.6} for the value of a reaction constant. I'm usually using siunitx to type numbers in scientific notation with \num{4e5} for instance. However recent versions don't allow decimal exponents anymore. I'm now left with many files filled with commands like \num{1e-5.6} that don't compile anymore.

What other package would parse numbers with decimal exponents ?

Best Answer

You could write a macro yourself, assuming that you don't have any complicated use cases. Of course, you won't have access to any of the other nice features of siunitx.

\documentclass{article}

\makeatletter
  \newcommand\dexp[1]{\@dexp#1\@stop}
  \def\@dexp#1e#2\@stop{%
    \ifx\relax#1\relax\else
      #1 \cdot
    \fi
    10^{#2}%
  }
\makeatother

\begin{document}

\(\dexp{e1.2}\)

\(\dexp{3e4.5}\)

\end{document}

MWE output

Related Question