4

For kWh, some numbers don't get rendered via exponent-to-prefix. Apparently all that should use Wh (without prefix):

\documentclass{article}

\usepackage{siunitx}
\sisetup{
    exponent-to-prefix = true,
    round-mode = places,
    round-precision = 3,
    scientific-notation = engineering,
}

\begin{document}

\SI{1000}{\kWh} % Works
\SI{100}{\kWh} % Works
\SI{10}{\kWh} % Works
\SI{1}{\kWh} % Works

\SI{0.1}{\kWh} % Fails
\SI{0.01}{\kWh} % Fails
\SI{0.001}{\kWh} % Fails

\SI{0.0001}{\kWh} % Works
\SI{0.00001}{\kWh} % Works
\SI{0.000001}{\kWh} % Works
\SI{0.0000001}{\kWh} % Works

\end{document}

I programmatically generate the numbers so I don't really know beforehand what range they fall into. Is there a way to make exponent-to-prefix work for all constellations?

1
  • 'Use v3'? The code here is completely re-worked and doesn't give an error for any of your examples.
    – Joseph Wright
    Commented Jul 20, 2021 at 13:14

1 Answer 1

2

Version 3 of siunitx should handle your input just fine. To deal with v2, you probably are best creating a 'prefix' that deal with the problem

\DeclareSIPrefix{\noop}{}{0}
1
  • Perfect. Now on to finding out how to update my LaTeX distribution :-)
    – mritz_p
    Commented Jul 20, 2021 at 13:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .