integer-to-ordinal-english

1.0.2 • Public • Published

Integer to Cardinal Ordinal

English ordinals from any integer

Install

npm install --save integer-to-ordinal-english

Usage

Import the package

const ordinal = require("integer-to-ordinal-english");

Pass in either an integer.

ordinal(127521);
// => "One Hundred and Twenty-Seven Thousand, Five Hundred and Twenty-First"

Or a cardinal number (like the output from Integer to Cardinal).

ordinal("One Hundred and Twenty-Seven Thousand, Five Hundred and Twenty-One");
// => "One Hundred and Twenty-Seven Thousand, Five Hundred and Twenty-First"

Limitations

Vocabulary is currently limited to

999,999,999,999,999

That is, the library does not currently support one quadrillion or higher.

Higher numbers are easily supported. If you need it, please don't be shy and open up a pull request!

Motivation & Related Work

Number Reference is an online encyclopedia of calculations that relies heavily on this and related packages.

License

Nice and Brief: BSD-3-Clause

Readme

Keywords

none

Package Sidebar

Install

npm i integer-to-ordinal-english

Weekly Downloads

15

Version

1.0.2

License

BSD-3-Clause

Unpacked Size

5.05 kB

Total Files

4

Last publish

Collaborators

  • timeemit