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.
npm i num-ord
const num_ord = require('num-ord');
num_ord(17); // => '17th'
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.
(c) 2018 - 2019 ThatTonybo. This project is not licenced under any official licences.