%%
%% This is file `fcolumn.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% fcolumn.dtx  (with options: `package')
%% 
%% This is a generated file.
%% 
%% Copyright (C) 2015--2022 by Edgar Olthof
%% 
%% This file may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3 of this license or (at your option) any later
%% version.  The latest version of this license is in
%% 
%%    http://www.latex-project.org/lppl.txt
%% 
%% and version 1.3 or later is part of all distributions of
%% LaTeX version 1999/12/01 or later.
\ProvidesPackage{fcolumn}
          [2022/02/01 v1.4.1 Automatic Currency Package (EHTO)]
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{array}[v2.4k]
\newif\ifstrict@ccounting \strict@ccountingfalse
\DeclareOption{strict}{\strict@ccountingtrue}
\ProcessOptions
\newcolumntype{F}[4]{>{\b@fi{#1}{#2}{#3}{#4}}r<{\e@fi}}
\newcolumntype{f}{F{.}{,}{3,2}{}}
\newcount\FCsc@l \FCsc@l=0 \newcount\FCtc@l \FCtc@l=0
\newif\ifwiths@p
\def\geldm@cro#1#2{\withs@pfalse
\afterassignment\g@ldm@cro\count@#1\relax{#2}}
\def\g@ldm@cro#1\relax#2{\FCform@t{\ifnum#2<0 \ifstrict@ccounting
  (\else -\fi \count2=-#2 \else\count2=#2 \fi
\count4=\ifx\relax#1\relax 2 \else \@gobble#1\relax\fi
\count3=0
\loop\ifnum\count3<\count4
  \divide\count2 by 10 \advance\count3 by \@ne
\repeat
\g@ldens{\the\count@}%
\ifnum\count3>0\decim@lmark
  \ifnum#2>0 \count2=-#2\else\count2=#2 \fi
  \loop\ifnum\count3>0
    \divide\count2 by 10 \advance\count3 by \m@ne
  \repeat
  \loop\ifnum\count3<\count4
    \multiply\count2 by 10 \advance\count3 by \@ne
  \repeat
  \ifnum#2>0 \advance\count2 by #2
  \else \advance\count2 by -#2
  \fi
  \zerop@d{\number\count3}{\number\count2}%
\fi
\ifx\FCs@gn\m@ne \ifnum#2<0 \ifstrict@ccounting
  \rlap{)~!}\else\rlap{~!}\fi\else\ifstrict@ccounting
  \rlap{\phantom{)}~!}\else\rlap{~!}\fi\fi
\else \ifnum#2<0 \ifstrict@ccounting\rlap{)}\fi\fi
\fi}}
\def\g@ldens#1{{\count3=\count2 \count0=#1
\ifnum\count0<1 \count0=3 \fi
\loop \ifnum\count0>0 \divide\count2 by 10 \advance\count0 by \m@ne
\repeat
\ifnum\count2>0 \g@ldens{#1}\fi
\count0=#1
\ifnum\count0<1 \count0=3 \fi
\loop \ifnum\count0>0 \multiply\count2 by 10 \advance\count0 by \m@ne
\repeat
\count2=-\count2
\advance\count2 by \count3 \du@zendprint{#1}}}
\def\du@zendprint#1{\ifwiths@p\ifnum#1>0 \sep@rator\fi
 \zerop@d{#1}{\number\count2}%
\else\zerop@d1{\number\count2}\fi\global\withs@ptrue}
\def\zerop@d#1#2{{\count0=1 \count1=#2
\loop \divide \count1 by 10 \ifnum\count1>0 \advance\count0 by \@ne
\repeat
\ifnum#1>0
 \loop \ifnum\count0<#1\relax 0\advance\count0 by \@ne
 \repeat
\else
 \advance\count0 by -3
 \loop \ifnum\count0<0 0\advance\count0 by \@ne
 \repeat
\fi\number#2}}
\def\zetg@ld#1#2{\count0=#2\relax \let\FCs@gn=\@ne
\ifnum\count0<0
  \ifnum\csname FCtot@\romannumeral\FCsc@l\endcsname<0
    \let\FCs@gn=\m@ne
  \fi
\fi
\ifnum\count0>0
  \ifnum\csname FCtot@\romannumeral\FCsc@l\endcsname>0
    \let\FCs@gn=\m@ne
  \fi
\fi
\global\advance\csname FCtot@\romannumeral\FCsc@l\endcsname by \count0
\ifx\FCs@gn\m@ne
  \ifnum\count0>0 \let\FCs@gn\@ne \fi
  \count0=\csname FCtot@\romannumeral\FCsc@l\endcsname
  \ifnum\FCs@gn<0 \count0=-\count0 \fi
  \ifnum\count0<0
    \let\FCs@gn=\m@ne
    \PackageError{fcolumn}{Register overflow}{Overflow occurred
    in fcolumn \number\FCsc@l.\MessageBreak You can press <enter>
    now and I'll proceed, but check\MessageBreak your table. The
    offending entry is indicated with an\MessageBreak exclamation
    mark in the output.}%
  \else\let\FCs@gn=\@ne
  \fi
\fi
\setbox0=\hbox{$\geldm@cro{#1}{#2}$}%
\ifdim\wd0>\csname FCwd@\romannumeral\FCsc@l\endcsname
 \global\csname FCwd@\romannumeral\FCsc@l\endcsname=\wd0
\fi\unhbox0}
\newcount\FC@l \newcount\FC@r
\def\setucc@de#1#2\relax{\uccode`\~=`#1 }
\def\assignform@t#1,#2,#3\assignform@t{\def\FCform@t{#1}%
  \def\FCform@tt{#2}\ifx\FCform@tt\@empty \def\FCform@tt{#1}\fi}
\def\m@thcodeswitch#1{\count0=10 \loop\ifnum\count0>0
\advance\count0 by \m@ne\mathcode\expandafter`\the\count0=
\ifnum#1=0 0 \else "8000 \fi\repeat}
\def\b@fi#1#2#3#4{%
\def\sep@xt##1##2\end{\def\sep@rator{{##1}}}\sep@xt#1\end
\def\decim@lmark{{#2}}\def\sp@l{#3}\assignform@t#4,,\assignform@t
\global\advance\FCsc@l by \@ne\global\FC@l=0 \global\FC@r=1
\let\FCs@gn=\@ne\relax \setbox0\hbox\bgroup$
\count@=10 \loop\ifnum\count@>0 \advance\count@ by \m@ne
 \uccode`\~=\expandafter`\the\count@ \uppercase{\edef~}{\noexpand
 \m@thcodeswitch0 \global\FC@l=\the\count@}\repeat
\def\deactdecm@rk##1##2\relax{\mathcode`##1=0 }%
\afterassignment\setucc@de\count@#3\relax
\uppercase{\def~}{\ifnum\mathcode`\0="8000 \m@thcodeswitch0 \fi
\afterassignment\deactdecm@rk\count@#3\relax \global\FC@r=1}%
\def\d@cm##1##2{\count@=\mathcode`##1 }
\ifnum\uccode`\~=`. \uccode`\~=`,\relax\else \uccode`\~=`.\relax\fi
\uppercase{\def~}{\ifnum\mathcode`\0="8000 \m@thcodeswitch0 \fi
\afterassignment\d@cm\count@#3\relax
\ifnum\count@=\mathcode`- \expandafter\global\FC@l=\the\FC@l
\else \expandafter\global\FC@r=\the\FC@r\fi}%
\uccode`\~=`+\relax \uppercase{\def~}{\ifnum\mathcode`\0="8000
\m@thcodeswitch0 \fi\global\FC@l=0}
\uccode`\~=`-\relax \uppercase{\def~}{\ifnum\mathcode`\0="8000
\m@thcodeswitch0 \fi\global\let\FCs@gn\m@ne \global\FC@l=0}%
\mathcode`-="8000 \mathcode`+="8000 \mathcode`.="8000
\m@thcodeswitch1 \def\actdecm@rk##1##2\relax{%
\ifx##1.\relax \mathcode`,="8000 \else \mathcode`##1="8000 \fi}%
\afterassignment\actdecm@rk\count@#3\relax}
\def\e@fi{\ifnum\mathcode`\0="8000 \global\FC@r=\m@ne\fi$\egroup
\ifnum\FC@r>0
 \ifnum\FC@r=1 \FC@r=10 \fi
 \def\i@ts##1##2{\count0=##2}
 \afterassignment\i@ts\count@\sp@l
 \loop\ifnum\count0>0 \multiply\FC@l by 10
  \expandafter\secd@xt\number\FC@r\secd@xt \advance\count0 by \m@ne
 \repeat
 \ifnum\expandafter\@gobble\number\FC@r>0
   \def\tw@l##1##2\relax{##2}
   \PackageWarning{fcolumn}{Excess digit\ifnum\FC@r>19 s\fi\space
   ``\expandafter\tw@l\number\FC@r\relax'' in decimal part
   \MessageBreak ignored near or}
 \fi
 \ifx\FCs@gn\m@ne\relax \FC@l=-\FC@l \fi
 \zetg@ld{\sp@l}{\FC@l}%
\fi}
\def\secd@xt#1#2#3\secd@xt{\advance\FC@l by #2
\FC@r=#1#3 \ifnum\FC@r=1 \FC@r=10 \fi}
\def\@array[#1]#2{\@tempdima\ht\strutbox\advance\@tempdima by
 \extrarowheight\setbox\@arstrutbox\hbox{\vrule\@height\arraystretch
 \@tempdima\@depth\arraystretch\dp\strutbox\@width\z@}%
\def\ialign{\everycr{\noalign{\global\FCsc@l=0 }}\tabskip\z@skip\halign}
\begingroup\@mkpream{#2}\xdef\@preamble{\noexpand\ialign\@halignto
\bgroup\@arstrut\@preamble\tabskip\z@\cr}%
\endgroup
\begingroup\@mksumline{#2}\endgroup
\res@tsumline
\@arrayleft\if #1t\vtop\else\if#1b\vbox\else\vcenter\fi\fi\bgroup
\let\@sharp ##\let\protect\relax\lineskip\z@\baselineskip\z@
\m@th \let\\\@arraycr \let\tabularnewline\\\let\par\@empty \@preamble}
\let\@@array=\@array
\def\@mksumline#1{\gdef\s@ml@ne{}\@lastchclass 4 \@firstamptrue
\global\FCsc@l=0
\let\prr@sult=\relax
\@temptokena{#1}\@tempswatrue\@whilesw\if@tempswa\fi{\@tempswafalse
\the\NC@list}\count0\m@ne\let\the@toks\relax\prepnext@tok
\expandafter\@tfor\expandafter\@nextchar\expandafter:\expandafter=\the
\@temptokena\do{\@testpach\ifcase\@chclass\@classfz\or\or\@classfii\or
\or\or\or\or\or\or\or\@classfx\fi\@lastchclass\@chclass}%
\xdef\s@ml@ne{\s@ml@ne\noexpand\aut@check\noexpand\\}}
\def\@addtosumline#1{\xdef\s@ml@ne{\s@ml@ne #1}}
\def\@classfx{\if@firstamp \@firstampfalse \else \@addtosumline &\fi}
\def\@classfz{\ifnum\@chnum<\thr@@ \@classfx\fi}
\def\@classfii{\ifnum\@lastchclass=8
 \edef\t@stm{\expandafter\string\@nextchar}
 \edef\t@stn{\string\e@fi}
 \ifx\t@stm\t@stn
  \@addtosumline{\prr@sult}
  \global\advance\FCsc@l by \@ne
  \ifnum\FCsc@l>\FCtc@l
   \expandafter\ifx\csname FCtot@\romannumeral\FCsc@l\endcsname\relax
    \expandafter\newcount\csname FCtot@\romannumeral\FCsc@l\endcsname
   \else
    \PackageError{fcolumn}{Name clash for <count>}{\expandafter\csname
    FCtot@\romannumeral\FCsc@l\endcsname is already defined and it may
    not even be a <count>. If you're\MessageBreak sure it is a <count>,
    you can press <enter> now and I'll proceed, but things\MessageBreak
    will get overwritten.}%
   \fi
   \expandafter\ifx\csname FCwd@\romannumeral\FCsc@l\endcsname\relax
    \expandafter\newdimen\csname FCwd@\romannumeral\FCsc@l\endcsname
    \global\FCtc@l=\FCsc@l
   \else
    \PackageError{fcolumn}{Name clash for <dimen>}{\expandafter\csname
    FCwd@\romannumeral\FCsc@l\endcsname is already defined and it may
    not even be a <dimen>. If you're\MessageBreak sure it is a <dimen>,
    you can press <enter> now and I'll proceed, but things\MessageBreak
    will get overwritten.}%
   \fi
  \fi
 \fi
\fi}
\newdimen\s@mlinesep
\def\sumline{\@ifnextchar[\s@mline{\s@mline[2pt]}}
\def\s@mline[#1]{\global\s@mlinesep=#1 \s@ml@ne}
\def\prr@sult{$\egroup \let\e@fi=\relax \let\FCform@t=\FCform@tt
\setbox0=\hbox{$\geldm@cro{\sp@l}{\number\csname
FCtot@\romannumeral\FCsc@l\endcsname}$}%
\ifdim\wd0>\csname FCwd@\romannumeral\FCsc@l\endcsname
 \global\csname FCwd@\romannumeral\FCsc@l\endcsname=\wd0
\fi
\vbox{\hrule width \csname FCwd@\romannumeral\FCsc@l\endcsname
\vskip\s@mlinesep
\hbox to \csname FCwd@\romannumeral\FCsc@l\endcsname{\hfil\unhbox0}}}
\def\leeg#1{$\egroup \let\e@fi=\relax #1}
\def\res@tsumline{\FCsc@l=\FCtc@l\loop\ifnum\FCsc@l>0
 \global\csname FCtot@\romannumeral\FCsc@l\endcsname=0
 \global\csname FCwd@\romannumeral\FCsc@l\endcsname=\z@
 \advance\FCsc@l by \m@ne\repeat}
\def\resetsumline{\noalign{\res@tsumline}}
\def\FC@chklist{}
\def\aut@check{\ifx\@empty\FC@chklist\relax
 \ifodd\FCsc@l\else
  \count0=\@ne \count1=\FCsc@l
  \divide\count1 by \tw@
  \loop\ifnum\count1<\FCsc@l
   \advance\count1 by \@ne
   \xdef\FC@chklist{\FC@chklist\number\count0,\number\count1;}%
   \advance\count0 by\@ne
  \repeat
 \fi
\fi
\loop
\ifx\FC@chklist\@empty\let\FCs@gn=\@ne\else\let\FCs@gn=\m@ne\fi
\ifx\FCs@gn\m@ne
 \expandafter\fre@t\FC@chklist\end
 \ifnum\csname FCtot@\romannumeral\count0\endcsname=
  \csname FCtot@\romannumeral\count1\endcsname\else
  \PackageWarning{fcolumn}{F-columns \number\count0 \space and
  \number\count1 \space do not balance due to \string\sumline
  \MessageBreak near or}%
 \fi
\repeat}
\def\fre@t#1,#2;#3\end{\count0=#1 \count1=#2 \xdef\FC@chklist{#3}}
\def\checkfcolumns#1#2{\noalign{\xdef\FC@chklist{\FC@chklist #1,#2;}}}
\ifx\longtable\@undefined
 \PackageWarningNoLine{fcolumn}{fcolumn is loaded without longtable.
 That's OK, but\MessageBreak if you want to load longtable as well,
 make sure \MessageBreak it is done before loading fcolumn}\else
 \def\LT@array[#1]#2{\refstepcounter{table}\stepcounter{LT@tables}\if
  l#1 \LTleft\z@\LTright\fill\else\if r#1 \LTleft\fill\LTright\z@\else
  \if c#1 \LTleft\fill\LTright\fill\fi\fi\fi\let\LT@mcol\multicolumn
  \let\LT@@tabarray\@tabarray\let\LT@@hl\hline\def\@tabarray{\let
  \hline\LT@@hl\LT@@tabarray}\let\\\LT@tabularcr\let\tabularnewline\\
  \def\newpage{\noalign{\break}}\def\pagebreak{\noalign{\ifnum`}=0\fi
  \@testopt{\LT@no@pgbk-}4}\def\nopagebreak{\noalign{\ifnum`}=0\fi
  \@testopt\LT@no@pgbk4}\let\hline\LT@hline\let\kill\LT@kill\let\caption
  \LT@caption\@tempdima\ht\strutbox\let\@endpbox\LT@endpbox\ifx
  \extrarowheight\@undefined\let\@acol\@tabacol\let\@classz\@tabclassz
  \let\@classiv\@tabclassiv\def\@startpbox{\vtop\LT@startpbox}\let
  \@@startpbox\@startpbox\let\@@endpbox\@endpbox\let\LT@LL@FM@cr
  \@tabularcr\else\advance\@tempdima\extrarowheight\col@sep\tabcolsep
  \let\@startpbox\LT@startpbox\let\LT@LL@FM@cr\@arraycr\fi\setbox
  \@arstrutbox\hbox{\vrule\@height\arraystretch\@tempdima\@depth
  \arraystretch\dp\strutbox\@width\z@}\let\@sharp##\let\protect\relax
  \begingroup\@mkpream{#2}\xdef\LT@bchunk{\global\advance\c@LT@chunks
  \@ne\global\LT@rows\z@\setbox\z@\vbox\bgroup\LT@setprevdepth\tabskip
  \LTleft\noexpand\halign to\hsize\bgroup\tabskip\z@\@arstrut\@preamble
  \tabskip\LTright\cr}\endgroup
  \begingroup\@mksumline{#2}\endgroup\res@tsumline
  \everycr{\noalign{\global\FCsc@l=0 }}%
  \expandafter\LT@nofcols\LT@bchunk&\LT@nofcols\LT@make@row\m@th\let
  \par\@empty\lineskip\z@\baselineskip\z@\LT@bchunk}
\fi
\endinput
%%
%% End of file `fcolumn.sty'.
