%% See file 'fnumprint.dtx' for copyright and licence.
\NeedsTeXFormat{LaTeX2e}[1998/12/01]
\ProvidesPackage{fnumprint}
    [2012/08/27 v1.1 Printing fancy numbers]
\RequirePackage{xifthen}
\RequirePackage[autolanguage]{numprint}
\newcounter{fnumprint@language}
\setcounter{fnumprint@language}{0}
\DeclareOption{german}{\setcounter{fnumprint@language}{1}}
\DeclareOption{ngerman}{\setcounter{fnumprint@language}{1}}
\DeclareOption{english}{\setcounter{fnumprint@language}{2}}
\DeclareOption{USenglish}{\setcounter{fnumprint@language}{2}}
\DeclareOption{american}{\setcounter{fnumprint@language}{2}}
\DeclareOption{UKenglish}{\setcounter{fnumprint@language}{2}}
\DeclareOption{british}{\setcounter{fnumprint@language}{2}}
\DeclareOption{canadian}{\setcounter{fnumprint@language}{2}}
\DeclareOption{australian}{\setcounter{fnumprint@language}{2}}
\DeclareOption{newzealand}{\setcounter{fnumprint@language}{2}}
\ProcessOptions\relax
\ifcase\value{fnumprint@language}
  \PackageWarning{\@currname}{No supported language selected
    \MessageBreak
    This package supports only English and German
    \MessageBreak
    There will be no word names printed}
\or
  \RequirePackage{zahl2string}
\or
  \newcommand{\ns@en@neunzehn}[1]{%
    \ifcase#1 zero\or one\or two\or three\or four\or five\or six\or%
    seven\or eight\or nine\or ten\or eleven\or twelve\or thirteen\or%
    fourteen\or fifteen\or sixteen\or seventeen\or%
    eighteen\or nineteen\fi%
  }
\fi
\DeclareRobustCommand{\fnumprint}[2][]{%
  \ifthenelse{\NOT \(\isin{,}{#2} \OR \isin{.}{#2} \)
  \AND -1 < #2 \AND #2 < 13}{%
    \ifthenelse{\value{fnumprint@language} = 1}{%
      \ifthenelse{\equal{#1}{ein} \AND #2 = 1}{ein}{\numstr{#2}}%
    }{%
      \ifthenelse{\value{fnumprint@language} = 2}{%
        \ns@en@neunzehn{#2}%
      }{\numprint{#2}}%
    }%
  }{\numprint{#2}}%
}
\DeclareRobustCommand{\fnumprintc}[2][]{%
  \ifthenelse{-1 < \value{#2} \AND \value{#2} < 13}{%
    \ifthenelse{\value{fnumprint@language} = 1}{%
    \ifthenelse{\equal{#1}{ein} \AND \value{#2} = 1}{ein}{\numstring{#2}}}{%
      \ifthenelse{\value{fnumprint@language} = 2}{%
        \ns@en@neunzehn{\value{#2}}%
      }{\cntprint{#2}}%
    }%
  }{\cntprint{#2}}%
}
\endinput
%%
%% End of file `fnumprint.sty'.
