Template:Number to word/documentation

From The Languages of David J. Peterson
Jump to navigation Jump to search
Documentation for Template:Number to word. [edit]
This page contains usage information, categories, interwiki links and other content describing the template.

Converts a given integer into a cardinal number or ordinal number in the English language. Anything between 10Template:Sup and −10Template:Sup is supported, as well as some larger numbers such as one centillion and one millinillion.

Usage

{{number to word|integer[|zero=zero][|adj=on][|us=on][|ord=on]}}

integer: Required. A natural number in the range of 10Template:Sup and −10Template:Sup is, as well as some larger numbers such as one centillion and one millinillion.

zero: Optional. The value to use when the number is 0. Default is "zero" for cardinal numbers, "zeroth" for ordinal numbers. Can be made empty or, for example, "none", "seed" or "one before the first" as appropriate for the context.

adj: Optional. If the value is "on", the output is hyphenated.

ord: Optional. If the value is "on", the output is an ordinal number, otherwise it is a cardinal number.

us: Optional. If the value is "on", the output of numbers does not include "and" to separate hundreds from smaller values, nor to separate thousands from hundreds. This accords with American usage as described at English numerals.

Examples

{{number to word|-999999|adj=on}} negative-nine-hundred-ninety-nine-thousand-nine-hundred-and-ninety-nine
{{number to word|-1001|us=on}} negative one thousand one
{{number to word|-235|us=on|adj=on}} negative-two-hundred-thirty-five
{{number to word|-100}} negative one hundred
{{number to word|-30}} negative thirty
{{number to word|0|zero=not a sausage|adj=on}} not-a-sausage
{{number to word|30}} thirty
{{number to word|100}} one hundred
{{number to word|235|us=on|adj=on}} two-hundred-thirty-five
{{number to word|1001}} one thousand and one
{{number to word|999999|adj=on}} nine-hundred-ninety-nine-thousand-nine-hundred-and-ninety-nine
{{number to word|999999|adj=on|ord=on}} nine-hundred-ninety-nine-thousand-nine-hundred-and-ninety-ninth
{{number to word|9999999999999999}} nine quadrillion nine hundred ninety-nine trillion nine hundred ninety-nine billion nine hundred ninety-nine million nine hundred ninety-nine thousand nine hundred and ninety-nine

Technical information

This template uses Module:ConvertNumeric.

See also