summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/fnumprint/fnumprint.sty
blob: 968cfa2a0e23afaad0bb41228ba6f4829cf38ec1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
%% See file 'fnumprint.dtx' for copyright and licence.
\NeedsTeXFormat{LaTeX2e}[1998/12/01]
\ProvidesPackage{fnumprint}
    [2012/08/27 v1.1a 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'.