Skip to content
Add the ordinal indicator to a integer. 1st, 2nd, 3rd, 4th, th!
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
.travis.yml
LICENSE
README.md
cli.js
index.js
package.json
test.js

README.md

Ordinal Numbers

Build Status

Add the ordinal indicator to a integer

Install

npm install --save ordinal-numbers

# OR install it globally for cli use

npm install -g ordinal-numbers

Use

var ordinal = require('ordinal-numbers')
ordinal(0) // => '0'
ordinal(13) // => '13th'

or in with import

import ordinal from 'ordinal-numbers'
ordinal(61) // => '61st'
ordinal(22) // => '22nd'

or if you installed it globally,

ordinal 83 # => 83rd

API

ordinal(integer)

convert an integer to a string with the ordinal indicator appended.

Bugs

Please report any bugs to: https://github.com/makenova/ordinal-numbers/issues

License

Licensed under the MIT License: https://opensource.org/licenses/MIT

You can’t perform that action at this time.