[latex3-commits] [l3svn] r6884 - Fix l3str-format breakage due to \fp_to_scientific:n change (see #258)

noreply at latex-project.org noreply at latex-project.org
Sat Feb 11 05:26:27 CET 2017


Author: bruno
Date: 2017-02-11 05:26:26 +0100 (Sat, 11 Feb 2017)
New Revision: 6884

Modified:
   trunk/l3experimental/l3str/l3str-format.dtx
Log:
Fix l3str-format breakage due to \fp_to_scientific:n change (see #258)


Modified: trunk/l3experimental/l3str/l3str-format.dtx
===================================================================
--- trunk/l3experimental/l3str/l3str-format.dtx	2017-02-11 04:07:04 UTC (rev 6883)
+++ trunk/l3experimental/l3str/l3str-format.dtx	2017-02-11 04:26:26 UTC (rev 6884)
@@ -881,6 +881,7 @@
 %
 % \begin{macro}[aux, EXP]{\@@_fp_g:wn}
 % \begin{macro}[aux, EXP]{\@@_fp_g_aux:wn}
+% \begin{macro}[aux, EXP]{\@@_fp_to_scientific:n, \@@_fp_trim:w}
 %   With the |g| type, first filter out special cases.  In the normal
 %   case, round to |#4| significant figures, then test the exponent: if
 %   $-4\leq \meta{exponent} < \meta{precision}$, use the presentation
@@ -909,14 +910,20 @@
 \cs_new:Npn \@@_fp_g_aux:wn #1; #2
   {
     \int_compare:nNnTF { \__fp_exponent:w #1; } < { -3 }
-      { \fp_to_scientific:n }
+      { \@@_to_scientific:n }
       {
         \int_compare:nNnTF { \__fp_exponent:w #1; } > {#2}
-          { \fp_to_scientific:n }
+          { \@@_to_scientific:n }
           { \fp_to_decimal:n }
       }
     { \__fp_set_sign_o:w 0 #1; @ \prg_do_nothing: }
   }
+\cs_new:Npn \@@_to_scientific:n
+  {
+    \exp_after:wN \@@_fp_trim:w
+    \exp:w \exp_end_continue_f:w \fp_to_scientific:n
+  }
+\cs_new:Npn \@@_fp_trim:w #1 e { \__fp_trim_zeros:w #1 ; e }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}



More information about the latex3-commits mailing list