[NTG-context] Converting numerals to text

Tom Tom at tuxedo-press.com
Mon Jun 28 05:22:43 CEST 2010

On Sun, 27 Jun 2010, Tom wrote:

> On Sat, Jun 26, 2010 at 22:31, Tom wrote:
>> Is there a command or macro that converts a numeral to its English
> language
>> equivalent? For example, I would like to display Thirteen for 13.
> http://wiki.contextgarden.net/Page_numbering_in_words
> http://thread.gmane.org/gmane.comp.tex.context/33962/focus=34304
> (there is an attachment t-counting.tex in that thread)
> Mojca
> The wiki includes the code for a macro, \numstr, that can be used to
> lower-case chapter numbers, but when I try to capitalize the first word,
> error messages. For example, the following errors out:
> Chapter \Word{\numstr{23}}
> As does
> Chapter \Words{\numstr{23}}
> but
> Chapter \numstr{23}
> Works as does
> Chapter \Words{twenty-three}
> However, the former returns twenty-three (all lower case)
> and the latter returns Twenty-three (only the first part is in upper case)
> It's not clear from the Chicago Manual of Style if three should be
> capitalized in this instance but, to my eye, it doesn't look right. Is
> a way to convert chapter numbers to text and select the desired
> capitalization?

If you want every word to be capitalized, simply change one, two, three, 
etc in the source of \numstr to One, Two, Three.


If I do that, they will always be in upper case. I would lose the option of
having them in lower case.

Tom Benjey
717-258-9733 voice
717-243-0074 fax
Twitter: @TomBenjey

More information about the ntg-context mailing list