Ordinals As Words In Compile

Hey, quick question:

How would I instruct the compiler to produce the following output:

Instead of “Chapter 1: Title” — “Chapter the First : Title”
Instead of “Chapter 2: Title” — “Chapter the Second: Title”
Instead of “Chapter 3: Title” — “Chapter the Third: Title”
Etcetera.

Is there a way to make it do this. maybe some creative combination of <$tags> I haven’t thought of?

—Andy H.

There’s no way, unfortunately. Another user asked about this recently. Numbers-as-words is handled by Apple’s NSNumberFormatter class, which can take any number and convert it to a word in the current language. But it can’t do the same for ordinals. So the only way I could do it is to hand-code this, which as you can imagine wouldn’t be exactly easy, because it would need different rules for each language.

All the best,
Keith