Converting numbers to words

Numbers are sometimes written in words rather than using numerals. LaTeX is capable of automatically converting numbers to words. This is especially useful for values which originate from LaTeX counters, such as page or section numbers.

How to do it...

Load the fmtcount package and use its commands for conversion:

  1. Start with any document class, such as article:
    \documentclass{article}
  2. Load the fmtcount package:
    \usepackage{fmtcount}
  3. Begin the document:
    \begin{document}
  4. Write some text. Use the following instructions:
    • Whenever you'd like to convert a number to a word, use the command \numberstringnum.
    • To print a counter value as a word, use \numberstring.
    • For a similar purpose, but in ordinal form, use \ordinalstringnum or \ordinalstring ...

Get LaTeX Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.