ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Robin Kirkham <robin.kirkham@csiro.au>
To: ntg-context@ntg.nl
Subject: Re: page numbering in words?
Date: Mon, 16 Apr 2007 22:52:12 +1000	[thread overview]
Message-ID: <AB5AFE62-DABC-4864-B464-E7A2CB46A7CB@csiro.au> (raw)

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
>

             reply	other threads:[~2007-04-16 12:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-16 12:52 Robin Kirkham [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-03-26 16:39 cormullion
2007-03-26 18:16 ` Wolfgang Schuster
2007-03-26 18:44   ` cormullion
2007-03-26 18:40 ` Wolfgang Schuster
2007-03-26 21:31   ` cormullion
2007-03-28 11:03 ` cormullion
2007-03-28 11:59   ` Zhichu Chen
2007-03-28 12:09   ` Wolfgang Schuster
2007-03-28 15:09     ` cormullion
2007-03-28 15:49       ` Zhichu Chen
2007-03-28 22:15         ` cormullion
2007-03-29  7:39           ` Taco Hoekwater
2007-04-17 11:09             ` Mojca Miklavec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AB5AFE62-DABC-4864-B464-E7A2CB46A7CB@csiro.au \
    --to=robin.kirkham@csiro.au \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).