diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmathfloat.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmathfloat.code.tex | 69 |
1 files changed, 58 insertions, 11 deletions
diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmathfloat.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmathfloat.code.tex index 6ef0b8f63ff..2f2ce4d9716 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmathfloat.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmathfloat.code.tex @@ -14,7 +14,7 @@ %%% - nested \input commands have been updated %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Date of this copy: Sa 30. Apr 21:00:37 CEST 2011 %%% +%%% Date of this copy: Do 29. Dez 12:39:03 CET 2011 %%% @@ -817,21 +817,23 @@ % #1: the part before the exponent code % #2: the part for the exponent code. \def\pgfmathfloatrounddisplaystyle@shared@impl@#1#2{% - {\toks0={#1}% + \begingroup + \toks0={#1}% \toks1=\expandafter{\pgfmathfloatrounddisplaystyle@e@mark #2}% \xdef\pgfmathfloat@glob@TMP{\the\toks0 \the\toks1 }% - }% + \endgroup \let\pgfmathresult=\pgfmathfloat@glob@TMP }% % Same as \pgfmathfloatrounddisplaystyle@shared@impl@, but it also % inserts the '@dec sep mark' at the end. \def\pgfmathfloatrounddisplaystyle@shared@impl@@#1#2{% - {\toks0={#1}% + \begingroup + \toks0={#1}% \toks1=\expandafter{\pgfmathfloatrounddisplaystyle@e@mark #2}% \pgfkeysgetvalue{/pgf/number format/@dec sep mark}\pgfmathprintnumber@fixed@styleDEFAULT@DEC@SEP@MARK \toks2=\expandafter{\pgfmathprintnumber@fixed@styleDEFAULT@DEC@SEP@MARK}% \xdef\pgfmathfloat@glob@TMP{\the\toks0 \the\toks1 \the\toks2 }% - }% + \endgroup \let\pgfmathresult=\pgfmathfloat@glob@TMP } @@ -846,10 +848,11 @@ } \def\pgfmathfloatrounddisplaystyle@e#1#2e#3\relax{% \ifnum#3<0\relax - {\count0=#3\relax + \begingroup + \count0=#3\relax \multiply\count0 by-1 \xdef\pgfmathfloat@glob@TMP{e{-}\the\count0}% - }% + \endgroup% \let\pgfmathresult=\pgfmathfloat@glob@TMP \else \def\pgfmathresult{e{+}#3}% @@ -859,10 +862,11 @@ } \def\pgfmathfloatrounddisplaystyle@E#1#2e#3\relax{% \ifnum#3<0\relax - {\count0=#3\relax + \begingroup + \count0=#3\relax \multiply\count0 by-1 \xdef\pgfmathfloat@glob@TMP{E{-}\the\count0}% - }% + \endgroup% \let\pgfmathresult=\pgfmathfloat@glob@TMP \else \def\pgfmathresult{E{+}#3}% @@ -905,6 +909,8 @@ \long\def\pgfmathfloatfrac@verbatim#1#2{#1/#2}% +\let\pgfmathround@@orig=\pgfmathround@ + \newif\ifpgfmathprintnumber@thousand@sep@in@fractional \pgfkeys{% /pgf/number format/.is family, @@ -914,9 +920,15 @@ std/.code= {\pgfmath@set@number@printer{pgfmathprintnumber@STD}\pgfmathprintnumber@STD@setparam{#1}}, std/.default=,% % relative={<exponent base 10>} - relative/.code= {\pgfmath@set@number@printer{pgfmathprintnumber@RELATIVE}\def\pgfmathprintnumber@RELATIVE@param{#1}},% + relative/.code= {% + \pgfmath@set@number@printer{pgfmathprintnumber@RELATIVE}% + \pgfmathround@@orig{#1}% + \expandafter\pgfmathfloattoint@@\pgfmathresult\relax + \let\pgfmathprintnumber@RELATIVE@param=\pgfmathresult + },% relative/.value required, every relative/.style=std, + fixed relative/.code= \pgfmath@set@number@printer{pgfmathprintnumber@FIXED@RELATIVE}, int detect/.code= \pgfmath@set@number@printer{pgfmathprintnumber@INT@DETECT}, int trunc/.code= \pgfmath@set@number@printer{pgfmathprintnumber@INT@TRUNC}, frac/.code= \pgfmath@set@number@printer{pgfmathprintnumber@frac},% @@ -1101,7 +1113,9 @@ \ifpgfmathfloatroundhasperiod\else.0\fi e\the\pgfmathfloat@a@E}% % call another formatter for the result (but avoid rounding inside of it): - \pgfqkeys{/pgf/number format}{/pgf/number format/every relative}% + \pgfqkeys{/pgf/number format}{/pgf/number format/every relative, + fixed zerofill=false,% useless here! + sci zerofill=false}% \ifx\pgfmathprintnumber@issci\pgfmathprintnumber@RELATIVE@issci \pgfmath@error{The '/pgf/number format/every relative' style should set a valid display style}% \fi @@ -1112,6 +1126,39 @@ \endgroup } +\def\pgfmathprintnumber@FIXED@RELATIVE#1{% + % parse the input: + \pgfmathfloatparsenumber{#1}% + \pgfmathfloat@to@FMeE@style\pgfmathresult + \expandafter\pgfmathprintnumber@FIXED@RELATIVE@issci\pgfmathresult\relax +} + +\def\pgfmathprintnumber@FIXED@RELATIVE@issci#1#2e#3\relax{% + \begingroup + \pgfmathfloatcreate{#1}{#2}{#3}% + % we want the first <precision> digits - not the first + % <precision>+1 digits: + \c@pgf@counta=\pgfmathfloat@round@precision\relax + \advance\c@pgf@counta by-1 + \edef\pgfmathfloat@round@precision{\the\c@pgf@counta}% + \pgfmathfloatround{\pgfmathresult}% + \pgfmathfloattoregisterstok\pgfmathresult\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E + \ifnum\pgfmathfloat@a@S=0 + \pgfmathfloat@a@E=\pgfmathfloat@a@S % avoid 0 * 10^8 + \fi + \edef\pgfmathresultX{% + \the\pgfmathfloat@a@S + \the\pgfmathfloat@a@Mtok + \ifpgfmathfloatroundhasperiod\else.0\fi + e\the\pgfmathfloat@a@E}% + \let\pgfmathfloat@round@precision@orig=\pgfmathfloat@round@precision + \pgfmathfloat@usezerofill@fixedfalse + \def\pgfmathfloat@round@precision{9999}% typeset all remaining digits! + \expandafter\pgfmathprintnumber@FIXED@issci\pgfmathresultX\relax% + \pgfmath@smuggleone\pgfmathresult + \endgroup +} + \def\pgfmathprintnumber@frac#1{% % parse the input: \pgfmathfloatparsenumber{#1}% |