Skip to content

number-reference/integer-to-ordinal-english

Repository files navigation

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

About

English ordinals from any integer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published