ordinal-numbers

Add the ordinal indicator to a integer

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
ordinal-numbers
101.0.37 years ago7 years agoMinified + gzip package size for ordinal-numbers in KB

Readme

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