english-ordinals
TypeScript icon, indicating that this package has built-in type declarations

3.3.0 • Public • Published

english-ordinals

A very simple Node.js module that gives the ordinal representation of numbers in English: 2 => second, 20 => twentieth, etc.

Based on:

  • n2words to first build cardinal numbers
  • make ordinals code thanks to Martin Eneqvist the author

Installation

npm install english-ordinals

Usage

const ordinals = require('english-ordinals');

// twentieth
console.log(`20 => ${ordinals.getOrdinal(20)}`);

dependencies

  • n2words under MIT license
  • contains code from number-to-words under MIT license

/english-ordinals/

    Package Sidebar

    Install

    npm i english-ordinals

    Weekly Downloads

    3,344

    Version

    3.3.0

    License

    MIT

    Unpacked Size

    7.46 kB

    Total Files

    9

    Last publish

    Collaborators

    • ludan.stoeckle