english - Maple Help

convert/english

convert a number to English

 Calling Sequence convert(n, english, opt) convert(m, english, cardinal, opt) convert(n, english, integer) convert(p, english, ordinal)

Parameters

 m - integer n - an integer or string opt - (optional) equation of the form And = true or And = false p - nonnegative integer

Description

 • For an integer n, the calling sequence convert(n, english) converts n to a string representation in words. For example, convert(5,english) returns the string "five". If n is a string, the reverse conversion is performed.
 • The calling sequence convert(n, english, cardinal) does exactly the same conversion as convert(n, english) for an integer n, and similarly convert(n, english, integer) does the same conversion as convert(n, english) for a string n.
 • These calling sequences use the so-called short scale: that is, "one billion" represents the number ${10}^{9}$ rather than ${10}^{12}$.
 • If the option And = true is specified, then this command includes the word "and" after the hundreds in numbers such as "six hundred and eighty-four". Specifying just And is equivalent to specifying And = true. If And = false is specified, then that same number is spelled as "six hundred eighty-four". The default is And = false.
 • Numbers greater than or equal to one thousand vigintillion (${10}^{66}$) in absolute sense are not supported.
 • The calling sequence convert(p, english, ordinal), for a nonnegative integer p, returns a string with the number p followed by a suffix to indicate an ordinal number in English. For example, convert(5, english, ordinal) returns the string "5th".

Examples

Cardinal numbers

Not supplying a third argument is the same as using the argument cardinal.

 > $\mathrm{convert}\left(0,'\mathrm{english}'\right)$
 ${"zero"}$ (1)
 > $\mathrm{convert}\left(0,'\mathrm{english}','\mathrm{cardinal}'\right)$
 ${"zero"}$ (2)

Negative numbers are supported.

 > $\mathrm{convert}\left(-5,'\mathrm{english}'\right)$
 ${"minus five"}$ (3)

The And option specifies whether the word and is included.

 > $\mathrm{convert}\left(905684,'\mathrm{english}'\right)$
 ${"nine hundred five thousand six hundred eighty-four"}$ (4)
 > $\mathrm{convert}\left(905684,'\mathrm{english}','\mathrm{And}'\right)$
 ${"nine hundred and five thousand six hundred and eighty-four"}$ (5)

Large numbers are also supported.

 > $\mathrm{convert}\left(12345678901234567890,'\mathrm{english}'\right)$
 ${"twelve quintillion three hundred forty-five quadrillion six hundred seventy-eight trillion nine hundred one billion two hundred thirty-four million five hundred sixty-seven thousand eight hundred ninety"}$ (6)

Very large numbers are not supported:

 > $\mathrm{convert}\left({10}^{66}-1,'\mathrm{english}'\right)$
 ${"nine hundred ninety-nine vigintillion nine hundred ninety-nine novemdecillion nine hundred ninety-nine octodecillion nine hundred ninety-nine septendecillion nine hundred ninety-nine sexdecillion nine hundred ninety-nine quindecillion nine hundred ninety-nine quattuordecillion nine hundred ninety-nine tredecillion nine hundred ninety-nine duodecillion nine hundred ninety-nine undecillion nine hundred ninety-nine decillion nine hundred ninety-nine nonillion nine hundred ninety-nine octillion nine hundred ninety-nine septillion nine hundred ninety-nine sextillion nine hundred ninety-nine quintillion nine hundred ninety-nine quadrillion nine hundred ninety-nine trillion nine hundred ninety-nine billion nine hundred ninety-nine million nine hundred ninety-nine thousand nine hundred ninety-nine"}$ (7)
 > $\mathrm{convert}\left({10}^{66},'\mathrm{english}'\right)$

Reverse Conversion of Cardinal Numbers

All reverse conversions are supported.

 > $m≔\mathrm{convert}\left(-1138,'\mathrm{english}'\right)$
 ${m}{≔}{"minus one thousand one hundred thirty-eight"}$ (8)
 > $\mathrm{convert}\left(m,'\mathrm{english}'\right)$
 ${-1138}$ (9)
 > $n≔\mathrm{convert}\left(8675309,'\mathrm{english}','\mathrm{And}'\right)$
 ${n}{≔}{"eight million six hundred and seventy-five thousand three hundred and nine"}$ (10)
 > $\mathrm{convert}\left(n,'\mathrm{english}'\right)$
 ${8675309}$ (11)

An optional second option integer can be used for clarity.

 > $\mathrm{convert}\left(n,'\mathrm{english}','\mathrm{integer}'\right)$
 ${8675309}$ (12)

Ordinal numbers

Supplying ordinal as the third argument gives ordinal numbers.

 > $\mathrm{convert}\left(0,'\mathrm{english}','\mathrm{ordinal}'\right)$
 ${"0th"}$ (13)
 > $\mathrm{convert}\left(1001,'\mathrm{english}','\mathrm{ordinal}'\right)$
 ${"1001st"}$ (14)
 > $\mathrm{convert}\left(123456789012345678902,'\mathrm{english}','\mathrm{ordinal}'\right)$
 ${"123456789012345678902nd"}$ (15)

Negative numbers are not supported.

 > $\mathrm{convert}\left(-3,'\mathrm{english}','\mathrm{ordinal}'\right)$

Compatibility

 • The convert/english command was introduced in Maple 17.