diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/fmtcount/fc-english.def')
-rw-r--r-- | Master/texmf-dist/tex/latex/fmtcount/fc-english.def | 345 |
1 files changed, 200 insertions, 145 deletions
diff --git a/Master/texmf-dist/tex/latex/fmtcount/fc-english.def b/Master/texmf-dist/tex/latex/fmtcount/fc-english.def index 4ee468d0dc5..2acb6582348 100644 --- a/Master/texmf-dist/tex/latex/fmtcount/fc-english.def +++ b/Master/texmf-dist/tex/latex/fmtcount/fc-english.def @@ -26,37 +26,37 @@ %% Right bracket \] Circumflex \^ Underscore \_ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} -\ProvidesFile{fc-english}[2005/04/29] -\newcommand{\@ordinalMenglish}[1]{% +\ProvidesFile{fc-english}[2007/04/20] +\newcommand*{\@ordinalMenglish}[2]{% +\def\@fc@ord{}% \@orgargctr=#1\relax \@ordinalctr=#1% \@modulo{\@ordinalctr}{100}% -\ifnum\@ordinalctr=11 -\the\@orgargctr\fmtord{th}% +\ifnum\@ordinalctr=11\relax + \def\@fc@ord{th}% \else -\ifnum\@ordinalctr=12 -\the\@orgargctr\fmtord{th}% -\else -\ifnum\@ordinalctr=13 -\the\@orgargctr\fmtord{th}% -\else -\@modulo{\@ordinalctr}{10}% -\ifcase\@ordinalctr -\the\@orgargctr\fmtord{th}% case 0 -\or \the\@orgargctr\fmtord{st}% case 1 -\or \the\@orgargctr\fmtord{nd}% case 2 -\or \the\@orgargctr\fmtord{rd}% case 3 -\else -\the\@orgargctr\fmtord{th}% default case -\fi -\fi -\fi -\fi + \ifnum\@ordinalctr=12\relax + \def\@fc@ord{th}% + \else + \ifnum\@ordinalctr=13\relax + \def\@fc@ord{th}% + \else + \@modulo{\@ordinalctr}{10}% + \ifcase\@ordinalctr + \def\@fc@ord{th}% case 0 + \or \def\@fc@ord{st}% case 1 + \or \def\@fc@ord{nd}% case 2 + \or \def\@fc@ord{rd}% case 3 + \else + \def\@fc@ord{th}% default case + \fi + \fi + \fi +\fi +\edef#2{\number#1\relax\noexpand\fmtord{\@fc@ord}}% } \let\@ordinalFenglish=\@ordinalMenglish -\providecommand{\andname}{and} - -\newcommand{\@@unitstringenglish}[1]{% +\newcommand*{\@@unitstringenglish}[1]{% \ifcase#1\relax zero% \or one% @@ -70,8 +70,7 @@ zero% \or nine% \fi } - -\newcommand{\@@tenstringenglish}[1]{% +\newcommand*{\@@tenstringenglish}[1]{% \ifcase#1\relax \or ten% \or twenty% @@ -84,8 +83,7 @@ zero% \or ninety% \fi } - -\newcommand{\@@teenstringenglish}[1]{% +\newcommand*{\@@teenstringenglish}[1]{% \ifcase#1\relax ten% \or eleven% @@ -99,8 +97,7 @@ ten% \or nineteen% \fi } - -\newcommand{\@@Unitstringenglish}[1]{% +\newcommand*{\@@Unitstringenglish}[1]{% \ifcase#1\relax Zero% \or One% @@ -114,8 +111,7 @@ Zero% \or Nine% \fi } - -\newcommand{\@@Tenstringenglish}[1]{% +\newcommand*{\@@Tenstringenglish}[1]{% \ifcase#1\relax \or Ten% \or Twenty% @@ -128,8 +124,7 @@ Zero% \or Ninety% \fi } - -\newcommand{\@@Teenstringenglish}[1]{% +\newcommand*{\@@Teenstringenglish}[1]{% \ifcase#1\relax Ten% \or Eleven% @@ -143,8 +138,7 @@ Ten% \or Nineteen% \fi } - -\newcommand{\@@numberstringenglish}[1]{% +\newcommand*{\@@numberstringenglish}[2]{% \ifnum#1>99999 \PackageError{fmtcount}{Out of range}% {This macro only works for values less than 100000}% @@ -156,70 +150,96 @@ you can try typing "minus" first, and then pass the modulus of this number}% \fi \fi +\def#2{}% \@strctr=#1\relax \divide\@strctr by 1000\relax \ifnum\@strctr>9 -\divide\@strctr by 10 -\ifnum\@strctr>1 -\@tenstring{\@strctr}% -\@strctr=#1 \divide\@strctr by 1000\relax -\@modulo{\@strctr}{10}% -\ifnum\@strctr>0 -\@unitstring{\@strctr}\fi -\else -\@strctr=#1\relax -\divide\@strctr by 1000 -\@modulo{\@strctr}{10}% -\@teenstring{\@strctr}% -\fi -\ \@thousand% + \divide\@strctr by 10 + \ifnum\@strctr>1\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@tenstring{\@strctr}}% + \@strctr=#1 \divide\@strctr by 1000\relax + \@modulo{\@strctr}{10}% + \ifnum\@strctr>0\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr-\@unitstring{\@strctr}}% + \fi + \else + \@strctr=#1\relax + \divide\@strctr by 1000\relax + \@modulo{\@strctr}{10}% + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@teenstring{\@strctr}}% + \fi + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\ \@thousand}% \else -\ifnum\@strctr>0 \@unitstring{\@strctr}\ \@thousand\fi + \ifnum\@strctr>0\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@unitstring{\@strctr}\ \@thousand}% + \fi \fi \@strctr=#1\relax \@modulo{\@strctr}{1000}% \divide\@strctr by 100 -\ifnum\@strctr>0 -\ifnum#1>1000 \ \fi\@unitstring{\@strctr}\ \@hundred% +\ifnum\@strctr>0\relax + \ifnum#1>1000\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\ }% + \fi + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@unitstring{\@strctr}\ \@hundred}% \fi \@strctr=#1\relax \@modulo{\@strctr}{100}% -\ifnum#1>100 \ifnum\@strctr>0 \ \andname\ \fi\fi -\ifnum\@strctr>19 -\divide\@strctr by 10 -\@tenstring{\@strctr}% -\@strctr=#1\relax \@modulo{\@strctr}{10}% -\ifnum\@strctr>0 --\@unitstring{\@strctr}% -\fi +\ifnum#1>100\relax + \ifnum\@strctr>0\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\ \@andname\ }% + \fi +\fi +\ifnum\@strctr>19\relax + \divide\@strctr by 10\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@tenstring{\@strctr}}% + \@strctr=#1\relax \@modulo{\@strctr}{10}% + \ifnum\@strctr>0\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr-\@unitstring{\@strctr}}% + \fi \else -\ifnum\@strctr<10 -\ifnum\@strctr=0 -\ifnum#1<100 \@unitstring{\@strctr}\fi -\else -\@unitstring{\@strctr}% -\fi -\else -\@modulo{\@strctr}{10}% -\@teenstring{\@strctr}% -\fi + \ifnum\@strctr<10\relax + \ifnum\@strctr=0\relax + \ifnum#1<100\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@unitstring{\@strctr}}% + \fi + \else + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@unitstring{\@strctr}}% + \fi + \else + \@modulo{\@strctr}{10}% + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@teenstring{\@strctr}}% + \fi \fi } - -\newcommand{\@numberstringMenglish}[1]{% +\DeclareRobustCommand{\@numberstringMenglish}[2]{% \let\@unitstring=\@@unitstringenglish \let\@teenstring=\@@teenstringenglish \let\@tenstring=\@@tenstringenglish \def\@hundred{hundred}\def\@thousand{thousand}% -\@@numberstringenglish{#1}} - +\def\@andname{and}% +\@@numberstringenglish{#1}{#2}% +} \let\@numberstringFenglish=\@numberstringMenglish - -\newcommand{\@NumberstringMenglish}[1]{% +\newcommand*{\@NumberstringMenglish}[2]{% \let\@unitstring=\@@Unitstringenglish \let\@teenstring=\@@Teenstringenglish \let\@tenstring=\@@Tenstringenglish \def\@hundred{Hundred}\def\@thousand{Thousand}% -\@@numberstringenglish{#1}} - +\def\@andname{and}% +\@@numberstringenglish{#1}{#2}} \let\@NumberstringFenglish=\@NumberstringMenglish -\newcommand{\@@unitthstringenglish}[1]{% +\newcommand*{\@@unitthstringenglish}[1]{% \ifcase#1\relax zeroth% \or first% @@ -233,8 +253,7 @@ zeroth% \or ninth% \fi } - -\newcommand{\@@tenthstringenglish}[1]{% +\newcommand*{\@@tenthstringenglish}[1]{% \ifcase#1\relax \or tenth% \or twentieth% @@ -247,8 +266,7 @@ zeroth% \or ninetieth% \fi } - -\newcommand{\@@teenthstringenglish}[1]{% +\newcommand*{\@@teenthstringenglish}[1]{% \ifcase#1\relax tenth% \or eleventh% @@ -262,8 +280,7 @@ tenth% \or nineteenth% \fi } - -\newcommand{\@@Unitthstringenglish}[1]{% +\newcommand*{\@@Unitthstringenglish}[1]{% \ifcase#1\relax Zeroth% \or First% @@ -277,8 +294,7 @@ Zeroth% \or Ninth% \fi } - -\newcommand{\@@Tenthstringenglish}[1]{% +\newcommand*{\@@Tenthstringenglish}[1]{% \ifcase#1\relax \or Tenth% \or Twentieth% @@ -291,8 +307,7 @@ Zeroth% \or Ninetieth% \fi } - -\newcommand{\@@Teenthstringenglish}[1]{% +\newcommand*{\@@Teenthstringenglish}[1]{% \ifcase#1\relax Tenth% \or Eleventh% @@ -306,8 +321,7 @@ Tenth% \or Nineteenth% \fi } - -\newcommand{\@@ordinalstringenglish}[1]{% +\newcommand*{\@@ordinalstringenglish}[2]{% \@strctr=#1\relax \ifnum#1>99999 \PackageError{fmtcount}{Out of range}% @@ -319,88 +333,129 @@ Tenth% you can try typing "minus" first, and then pass the modulus of this number}% \fi +\def#2{}% \fi \@strctr=#1\relax \divide\@strctr by 1000\relax -\ifnum\@strctr>9 -\divide\@strctr by 10 -\ifnum\@strctr>1\relax - \@tenstring{\@strctr}% - \@strctr=#1\relax - \divide\@strctr by 1000\relax - \@modulo{\@strctr}{10}% - \ifnum\@strctr>0 -\@unitstring{\@strctr}\fi -\else - \@strctr=#1\relax \divide\@strctr by 1000\relax - \@modulo{\@strctr}{10}% - \@teenstring{\@strctr}% -\fi -\@strctr=#1\relax \@modulo{\@strctr}{1000}% -\ifnum\@strctr=0\ \@thousandth\else\ \@thousand \fi +\ifnum\@strctr>9\relax + \divide\@strctr by 10 + \ifnum\@strctr>1\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@tenstring{\@strctr}}% + \@strctr=#1\relax + \divide\@strctr by 1000\relax + \@modulo{\@strctr}{10}% + \ifnum\@strctr>0\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr-\@unitstring{\@strctr}}% + \fi + \else + \@strctr=#1\relax \divide\@strctr by 1000\relax + \@modulo{\@strctr}{10}% + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@teenstring{\@strctr}}% + \fi + \@strctr=#1\relax \@modulo{\@strctr}{1000}% + \ifnum\@strctr=0\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\ \@thousandth}% + \else + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\ \@thousand}% + \fi \else -\ifnum\@strctr>0\relax -\@unitstring{\@strctr}% -\@strctr=#1\relax \@modulo{\@strctr}{1000}% -\ifnum\@strctr=0\ \@thousandth\else\ \@thousand\fi -\fi + \ifnum\@strctr>0\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@unitstring{\@strctr}}% + \@strctr=#1\relax \@modulo{\@strctr}{1000}% + \let\@@fc@ordstr#2\relax + \ifnum\@strctr=0\relax + \edef#2{\@@fc@ordstr\ \@thousandth}% + \else + \edef#2{\@@fc@ordstr\ \@thousand}% + \fi + \fi \fi \@strctr=#1\relax \@modulo{\@strctr}{1000}% \divide\@strctr by 100 -\ifnum\@strctr>0 -\ifnum#1>1000 \ \fi\@unitstring{\@strctr}% -\@strctr=#1\relax \@modulo{\@strctr}{100}% -\ifnum\@strctr=0\ \@hundredth\else\ \@hundred\fi +\ifnum\@strctr>0\relax + \ifnum#1>1000\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\ }% + \fi + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@unitstring{\@strctr}}% + \@strctr=#1\relax \@modulo{\@strctr}{100}% + \let\@@fc@ordstr#2\relax + \ifnum\@strctr=0\relax + \edef#2{\@@fc@ordstr\ \@hundredth}% + \else + \edef#2{\@@fc@ordstr\ \@hundred}% + \fi \fi \@strctr=#1\relax \@modulo{\@strctr}{100}% -\ifnum#1>100 \ifnum\@strctr>0\ and \fi\fi -\ifnum\@strctr>19 -\@tmpstrctr=\@strctr -\divide\@strctr by 10 -\@modulo{\@tmpstrctr}{10}% -\ifnum\@tmpstrctr=0 \@tenthstring{\@strctr}\else \@tenstring{\@strctr}\fi -\@strctr=#1\relax \@modulo{\@strctr}{10}% -\ifnum\@strctr>0 --\@unitthstring{\@strctr}% -\fi -\else -\ifnum\@strctr<10 -\ifnum\@strctr=0 -\ifnum#1<100 \@unitthstring{\@strctr}\fi +\ifnum#1>100\relax + \ifnum\@strctr>0\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\ \@andname\ }% + \fi +\fi +\ifnum\@strctr>19\relax + \@tmpstrctr=\@strctr + \divide\@strctr by 10\relax + \@modulo{\@tmpstrctr}{10}% + \let\@@fc@ordstr#2\relax + \ifnum\@tmpstrctr=0\relax + \edef#2{\@@fc@ordstr\@tenthstring{\@strctr}}% + \else + \edef#2{\@@fc@ordstr\@tenstring{\@strctr}}% + \fi + \@strctr=#1\relax \@modulo{\@strctr}{10}% + \ifnum\@strctr>0\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr-\@unitthstring{\@strctr}}% + \fi \else -\@unitthstring{\@strctr}% -\fi -\else -\@modulo{\@strctr}{10}% -\@teenthstring{\@strctr}% -\fi + \ifnum\@strctr<10\relax + \ifnum\@strctr=0\relax + \ifnum#1<100\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@unitthstring{\@strctr}}% + \fi + \else + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@unitthstring{\@strctr}}% + \fi + \else + \@modulo{\@strctr}{10}% + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@teenthstring{\@strctr}}% + \fi \fi } - -\newcommand{\@ordinalstringMenglish}[1]{% +\DeclareRobustCommand{\@ordinalstringMenglish}[2]{% \let\@unitthstring=\@@unitthstringenglish \let\@teenthstring=\@@teenthstringenglish \let\@tenthstring=\@@tenthstringenglish \let\@unitstring=\@@unitstringenglish \let\@teenstring=\@@teenstringenglish \let\@tenstring=\@@tenstringenglish +\def\@andname{and}% \def\@hundred{hundred}\def\@thousand{thousand}% \def\@hundredth{hundredth}\def\@thousandth{thousandth}% -\@@ordinalstringenglish{#1}} - +\@@ordinalstringenglish{#1}{#2}} \let\@ordinalstringFenglish=\@ordinalstringMenglish - -\newcommand{\@OrdinalstringMenglish}[1]{% +\DeclareRobustCommand{\@OrdinalstringMenglish}[2]{% \let\@unitthstring=\@@Unitthstringenglish \let\@teenthstring=\@@Teenthstringenglish \let\@tenthstring=\@@Tenthstringenglish \let\@unitstring=\@@Unitstringenglish \let\@teenstring=\@@Teenstringenglish \let\@tenstring=\@@Tenstringenglish +\def\@andname{and}% \def\@hundred{Hundred}\def\@thousand{Thousand}% \def\@hundredth{Hundredth}\def\@thousandth{Thousandth}% -\@@ordinalstringenglish{#1}} - +\@@ordinalstringenglish{#1}{#2}} \let\@OrdinalstringFenglish=\@OrdinalstringMenglish - \endinput %% %% End of file `fc-english.def'. |