Hi all,

There are still a few problems with \numstr when you get beyond the  
hundreds. Perhaps this is unlikely when it is a page number, but I  
was interested in using this macro for contracts, where an amount of  
money is often written out in words.

\input numstr.tex
\starttext
\numstr{-1}\par
\numstr{0}\par
\numstr{101}\par
\numstr{1001}\par
\numstr{1000001}\par
\numstr{1200021}
\stoptext

This produces output:

null
null
one hundred and one
one thousand one
one millionone
one million two hundred thousand twenty-one

which should be:

minus one
zero
one hundred and one
one thousand and one
one million and one
one million, two hundred thousand and twenty-one

In English, the tens/units (if not zero) should be preceded by "and"  
if the number exceeds 100 (so 101 is correct in the above output).  
This applies whether the tens/units is truly tens/units, or is a  
thousands or millions multiplier (120000 = "one hundred and twenty  
thousand").

The use of a comma after millions and sometimes thousands is helpful  
but not essential, and it only appears in certain cases. I'll have to  
think a bit more about a rule for that!

The use of a hyphen between tens and units ("twenty-one") is not  
incorrect but is nowadays probably regarded as a little old-fashioned  
(but personally, I like it).

Best,

Robin

> Date: 2007-03-29 17:38 +1000
> To: mailing list for ConTeXt users
> Subject: Re: [NTG-context] page numbering in words?
> cormullion.at.remove.this.mac.com wrote:
> > On 2007-03-28, at 16:49.0, Zhichu Chen wrote:
> >
> >> I modified Wolfgang's macro as the attached file. But I'm really
> >> not a native American, so there must be some special rules that
> >> I've ignored. Wish you good luck.
> >
> > Yes - this works great now. Thank you for sorting out the TeX code,
> > which is like no other language I know ;-). I've changed only one
> > spelling (fourty -> forty) and the rest looks perfect.
>
> It would be nice if someone (one of the module tutorial attendants :-)
> could wrap this command in a module for the contextgarden page.
>
> Cheers,
> Taco
>
_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

Reply via email to