%%
%% 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--2019 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}
          [2019/04/24 v1.2 Automatic Currency Package (EHTO)]
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{array}[v2.4k]
\newif\ifstrict@ccounting \strict@ccountingfalse
\DeclareOption{strict}{\strict@ccountingtrue}
\ProcessOptions
\newcolumntype{F}[3]{>{\b@fi{#1}{#2}{#3}}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{\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
  \multiply\count0 by \FCs@gn
  \ifnum\count0<0
    \let\FCs@gn=\m@ne
    \PackageError{fcolumn}{Register overflow}{Overflow occurred
    in fcolumn \number\FCsc@l. Check your table.}%
  \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\FC@chklist{}
\def\setucc@de#1#2\relax{\uccode`\~=`#1 }
\def\b@fi#1#2#3{%
\def\sep@xt##1##2\end{\def\sep@rator{{##1}}}%
\sep@xt#1\end\def\decim@lmark{{#2}}%
\def\sp@l{#3}\global\advance\FCsc@l by \@ne
\global\FC@l=0 \global\FC@r=1
\let\FCs@gn=\@ne\relax \setbox0\hbox\bgroup$%
\uccode`\~=`0\relax \uppercase{\def~}{\restorem@thcodes \global\FC@l=0}
\uccode`\~=`1\relax \uppercase{\def~}{\restorem@thcodes \global\FC@l=1}
\uccode`\~=`2\relax \uppercase{\def~}{\restorem@thcodes \global\FC@l=2}
\uccode`\~=`3\relax \uppercase{\def~}{\restorem@thcodes \global\FC@l=3}
\uccode`\~=`4\relax \uppercase{\def~}{\restorem@thcodes \global\FC@l=4}
\uccode`\~=`5\relax \uppercase{\def~}{\restorem@thcodes \global\FC@l=5}
\uccode`\~=`6\relax \uppercase{\def~}{\restorem@thcodes \global\FC@l=6}
\uccode`\~=`7\relax \uppercase{\def~}{\restorem@thcodes \global\FC@l=7}
\uccode`\~=`8\relax \uppercase{\def~}{\restorem@thcodes \global\FC@l=8}
\uccode`\~=`9\relax \uppercase{\def~}{\restorem@thcodes \global\FC@l=9}
\def\deactdecm@rk##1##2\relax{\mathcode`##1=0 }%
\afterassignment\setucc@de\count@#3\relax
\uppercase{\def~}{\ifnum\mathcode`\0=\mathcode`- \restorem@thcodes\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=\mathcode`- \restorem@thcodes\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=\mathcode`-
\restorem@thcodes\fi\global\FC@l=0}%
\uccode`\~=`-\relax
\uppercase{\def~}{\ifnum\mathcode`\0=\mathcode`-
\restorem@thcodes\fi\global\let\FCs@gn\m@ne \global\FC@l=0}%
\mathcode`-="8000 \mathcode`+=\mathcode`- \mathcode`.=\mathcode`-
\def\actdecm@rk##1##2\relax{\ifx##1.\relax \mathcode`,=\mathcode`-
\else \mathcode`##1=\mathcode`- \fi}%
\afterassignment\actdecm@rk\count@#3\relax
\mathcode`\0=\mathcode`- \mathcode`\1=\mathcode`-
\mathcode`\2=\mathcode`- \mathcode`\3=\mathcode`-
\mathcode`\4=\mathcode`- \mathcode`\5=\mathcode`-
\mathcode`\6=\mathcode`- \mathcode`\7=\mathcode`-
\mathcode`\8=\mathcode`- \mathcode`\9=\mathcode`- }
\def\e@fi{\ifnum\mathcode`\0=\mathcode`- \global\FC@r=\m@ne\fi$\egroup
\ifnum\FC@r>0
 \ifnum\FC@r<10 \multiply\FC@r by 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\end \advance\count0 by \m@ne
 \repeat
 \ifnum\FC@r>10
   \def\tw@l##1##2\relax{##2}
   \PackageWarning{fcolumn}{Excess digit\ifnum\FC@r>100 s\fi\space
   ``\expandafter\tw@l\number\FC@r\relax'' in decimal part
   \MessageBreak ignored}
 \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\end{\advance\FC@l by #2
\FC@r=#1#3 \ifnum\FC@r<10 \multiply\FC@r by 10 \fi}
\def\restorem@thcodes{\mathcode`\0=0 \mathcode`\1=0
\mathcode`\2=0 \mathcode`\3=0 \mathcode`\4=0 \mathcode`\5=0
\mathcode`\6=0 \mathcode`\7=0 \mathcode`\8=0 \mathcode`\9=0 }
\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
\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\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
      \PackageWarningNoLine{fcolumn}{F-columns \number\count0 \space
      and \number\count1 \space do not balance}%
    \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;}}}
\endinput
%%
%% End of file `fcolumn.sty'.
