ThatTonybo / num-ord

Converts intergers to ordinal numbers.

Home Page:https://www.npmjs.com/package/num-ord

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

Converts intergers to ordinal numbers.

https://www.npmjs.com/package/num-ord

License:MIT License


Languages

Language:JavaScript 100.0%