From 32c191d57a5b2fbf62d52f9b56dde34ea98be79c Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 4 Apr 2022 20:56:29 +0000 Subject: siunitx (4apr22) git-svn-id: svn://tug.org/texlive/trunk@62903 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/siunitx/siunitx-number.dtx | 48 ++++++++++++---------- 1 file changed, 27 insertions(+), 21 deletions(-) (limited to 'Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx') diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx index 19b505bc333..4f3708e7065 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx @@ -2112,9 +2112,9 @@ % % \begin{macro}{\@@_digits:NN} % \begin{macro}[EXP]{\@@_digits:nnnnnnn} -% \begin{macro}[EXP]{\@@_digits:Nn} % \begin{macro}[EXP]{\@@_digits:nn} -% \begin{macro}[EXP]{\@@_digits_S:n} +% \begin{macro}[EXP]{\@@_digits_uncert:nnn} +% \begin{macro}[EXP]{\@@_digits_uncert_S:nn} % Forcing a minimum number of digits in each part is quite easy. As % the common case is that we don't do anything here, there is no real need % to optimise the calculation (normally also numbers have only a few digits). @@ -2128,31 +2128,37 @@ { \exp_not:n { {#1} {#2} } { - \@@_digits:Nn \l_@@_min_integer_int {#3} + \@@_digits:nn \l_@@_min_integer_int {#3} \exp_not:n {#3} } { \exp_not:n {#4} - \@@_digits:Nn \l_@@_min_decimal_int {#4} + \@@_digits:nn \l_@@_min_decimal_int {#4} } - { \tl_if_blank:nF {#5} { \@@_digits_uncert:nn #5 } } + { \tl_if_blank:nF {#5} { \@@_digits_uncert:nnn {#4} #5 } } \exp_not:n { {#6} {#7} } } -\cs_new:Npn \@@_digits:Nn #1#2 +\cs_new:Npn \@@_digits:nn #1#2 { \int_compare:nNnT { #1 - \tl_count:n {#2} } > 0 - { \prg_replicate:nn { #1 - \tl_count:n {#2} } { 0 } } + { \prg_replicate:nn { #1 - \tl_count:n {#2} } { 0 } } } -\cs_new:Npn \@@_digits_uncert:nn #1#2 +\cs_new:Npn \@@_digits_uncert:nnn #1#2#3 { - { #1 } - { \use:c { @@_digits_uncert_ #1 :n } {#2} } + { #2 } + { \use:c { @@_digits_uncert_ #2 :nn } {#1} {#3} } } -\cs_new:Npn \@@_digits_uncert_S:n #1 +\cs_new:Npn \@@_digits_uncert_S:nn #1#2 { - \exp_not:n {#1} - \@@_digits:Nn \l_@@_min_decimal_int {#1} + \exp_not:n {#2} + \@@_digits:nn + { + \int_max:nn + { 0 } + { \l_@@_min_decimal_int - \tl_count:n {#1} + 1 } + } + {#2} } % \end{macrocode} % \end{macro} @@ -3643,25 +3649,25 @@ \exp_not:n {#5} \exp_not:V \l_@@_exponent_base_tl ^ - { \@@_output_exponent_auxiii:nn {#1} {#2} } + { \@@_output_exponent_auxiii:nnn { } {#1} {#2} } } \cs_new:Npn \@@_output_exponent_auxii:nnnnn #1#2#3#4#5 { \exp_not:n {#5} \exp_not:V \l_@@_output_exp_marker_tl - \@@_output_exponent_auxiii:nn {#1} {#2} + \@@_output_exponent_auxiii:nnn { \mathord } {#1} {#2} } -\cs_new:Npn \@@_output_exponent_auxiii:nn #1#2 +\cs_new:Npn \@@_output_exponent_auxiii:nnn #1#2#3 { - \tl_if_blank:nTF {#1} + \tl_if_blank:nTF {#2} { \bool_lazy_and:nnT { \l_@@_implicit_plus_bool } - { ! \str_if_eq_p:nn {#2} { 0 } } - { + } + { ! \str_if_eq_p:nn {#3} { 0 } } + { #1 + } } - { \exp_not:n {#1} } - \@@_output_digits:nn { integer } {#2} + { \exp_not:n {#1#2} } + \@@_output_digits:nn { integer } {#3} } % \end{macrocode} % A do-nothing marker used to allow shuffling of the output and so expandable -- cgit v1.2.3