Graphics, Figures & Tables[SOLVED] siunitx \num{} convert to engineering notation

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
gallioleo
Posts: 13
Joined: Thu Nov 18, 2021 6:35 pm

[SOLVED] siunitx \num{} convert to engineering notation

Post by gallioleo »

Hi Tex Community,

i try to convert a scientific numer, f.e. 100e3 to the belonging engineering notation 100k. With a unit works this proper with \SI{}{}, but when i try only a number with \num{} then i get only the exponential notation. Does anyone has an idea how \num{100e3} produces as output 100k.

Code: Select all

\documentclass[
        12pt,
        DIV=14,
        final
]{scrreprt}

\usepackage[english]{babel}
\usepackage[binary-units=true, detect-all]{siunitx}[=v2]

% siunitx settings
\sisetup {
    exponent-to-prefix  = true,         % convert exponents into belonging prefixes
    round-mode          = places,
    scientific-notation = engineering,  % try to use next engineering unit instead of '.'
    per-mode            = symbol,
    per-symbol          = /
}

% List used package version
\listfiles

% Start Document
\begin{document}

Try to get 100k with \textbackslash num{} \num{100e3}.

Try to get 100kA with \textbackslash SI{} \SI{100e3}{\ampere}.

\end{document}
Thanks for your help!

Best Regards,
Andreas
Last edited by gallioleo on Sun Feb 06, 2022 1:19 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Bartman
Posts: 369
Joined: Fri Jan 03, 2020 2:39 pm

siunitx \num{} convert to engineering notation

Post by Bartman »

gallioleo wrote:Does anyone has an idea how \num{100e3} produces as output 100k.
No, but the approach described in section 9.15 "Demonstrating prefixes" seems to work with the older version of the package as well.

Code: Select all

\documentclass[
  fontsize=12pt,% changed because of the package info in the log file
  DIV=14,
%  draft% changed for the same reason as before
        % and commented out because of the default setting
]{scrreprt}

\usepackage[english]{babel}
\usepackage[binary-units=true, detect-all]{siunitx}[=v2]

% siunitx settings
\sisetup {
    exponent-to-prefix  = true,       % convert exponents into belonging prefixes
    round-mode          = places,
    scientific-notation = engineering,% try to use next engineering unit instead of '.'
    per-mode            = symbol,
    per-symbol          = /
}

\DeclareSIUnit{\noop}{\relax}% added

\begin{document}
Try to get 100k with \verb!\num! \num{100e3}.

Try to get 100kA with \verb!\SI! \SI{100e3}{\ampere}.

Try to get 100k with \verb!\SI! \SI{100e3}{\noop}.% added
\end{document}
gallioleo
Posts: 13
Joined: Thu Nov 18, 2021 6:35 pm

siunitx \num{} convert to engineering notation

Post by gallioleo »

Thanks!
Post Reply