Nondeterministic Polynomial Munchies
    Wondering what’s next for npm?Check out our public roadmap! »

    js-ordinal

    1.0.1 • Public • Published

    Simple utility to translate numeral to their english ordinal representation.

    Install

    npm

    npm install --save js-ordinal

    yarn

    yarn add js-ordinal

    Few Examples

    const o = require('js-ordinal')
     
    o.toOrdinal(1) // '1st'
    o.toOrdinal(2) // '2nd'
     
    o.toOrdinal(11) // '11th'
    o.toOrdinal(12) // '12th'
     
    o.toOrdinal(21) // '21st'

    Getting only ordinal

    o.ordinalSuffix(1) // 'st'

    Install

    npm i js-ordinal

    DownloadsWeekly Downloads

    2

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    3.32 kB

    Total Files

    5

    Last publish

    Collaborators

    • avatar