Skip to content

ThatTonybo/num-ord

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

num-ord

This module allows you to easily convert inteters (1, 3, 7) to ordinals (1st, 3rd, 7th). This is unmaintained, but works fine and can be used if wanted.

Install

npm i num-ord

Example

const num_ord = require('num-ord');
num_ord(17); // => '17th'

Usage

First, require the package somewhere in your code:

const num_ord = require('num-ord');

Then, call it as a function when needed:

num_ord(17); // => '17th'

You can also directly require it to save space:

require('num-ord')(17); // => '17th'

It will parse strings to numbers if a string is passed and is a valid number.

Licence

(c) 2018 - 2019 ThatTonybo. This project is not licenced under any official licences.

Releases

No releases published

Packages

No packages published