How do I get an uppercase ordinal to number with memoir class?

The memoir class has a number of macros for converting a number to words. For example

 \numtotoname{113}


will print one hundred and thirteen.

Is there an equivalent macro for all caps? Alternatively can one define one?

I am trying to define:

   \def\thechapter{\textsc{\numtoname{\@arabic\c@chapter}}}


This works,

   \textsc{\numtoname{\@arabic\c@chapter}},


but not this one:

   \def\chaptername{chapter}
\def\thechapter{\textsc{\numtoname{\@arabic\c@chapter}}}


Note:

I am trying to convert chapter numbers to words. My guess is the answer probably need a number of \expandafters, which currently they evade me.

-
Do you mean "One Hundred and Thirteen" or "ONE HUNDRED AND THIRTEEN"? I guess the former, as the latter could be done either by \MakeUppercase{} or (somewhat?) by \textsc{}. – Brent.Longborough Apr 25 '12 at 19:11
@Brent.Longborough I mean ONE HUNDRED AND THIRTEEN try it with \MakeUppercase{} :) Never thought textsc. This works will you please post the comment as an answer so i can accept it? – Yiannis Lazarides Apr 25 '12 at 19:12
@Brent.Longborough Sorry did not work in the real application. – Yiannis Lazarides Apr 25 '12 at 19:25
@YiannisLazarides Unfortunately \numtoname uses \n@me@number which starts with \numdigits which is not expandable. So it won't work with any number of \expandafter tokens. One would have to define an "uppercase version" of \n@me@number with different versions of the \nNamezzzz macros. If you don't have a big number of chapters, the easiest way is to go with \ifcase – egreg Apr 25 '12 at 19:47
There is an interesting insight about expandable macro programming hidden in here. Sometimes it seems moot trying to make an expandable macro by all means, even in contexts where no significant advantage in efficiency is to be gained. But here, with an expandable definition of \n@me@number it would have been super easy to define an all-upper-case version while the way things are it's almost impossible without a complete rewrite. – Stephan Lehmke Apr 25 '12 at 20:03

The easiest solution is to use fmtcount:

\documentclass{memoir}
\let\ordinal\relax % to avoid a spurious warning
\usepackage{fmtcount}
\renewcommand{\thechapter}{\NUMBERstring{chapter}}

\begin{document}
\mainmatter
\chapter{A}
\end{document}

-

You can use the fmtcount package's \NUMBERstring:

\documentclass{memoir}% http://ctan.org/pkg/memoir
\usepackage{fmtcount}% http://ctan.org/pkg/fmtcount
\renewcommand{\thechapter}{\NUMBERstring{chapter}}
\begin{document}
\setcounter{chapter}{112}
\chapter{A chapter}
\end{document}​

-
Thanks. I accepted egreg's answer as he posted 44 seconds earlier than you:) – Yiannis Lazarides Apr 25 '12 at 20:01
@YiannisLazarides: That crazy! ...but fair. :) – Werner Apr 25 '12 at 20:06
if you hover over the answered ... it gives the time:) – Yiannis Lazarides Apr 25 '12 at 20:10

{\scshape \NumToName{#1}}