ordin

Ordinal numbers, in Node

Usage no npm install needed!

<script type="module">
  import ordin from 'https://cdn.skypack.dev/ordin';
</script>

README

ordin

Ordinal numbers, in Node

GitHub | NPM

Install

npm i ordin

Usage

First, require the library.

const ordin = require('ordin')
ordin(1)

// => 1st

ordin(14)

// => 14th

ordin(153)

// => 153rd

Thanks

Thanks to this Stack Overflow answer for providing information, specifically all of the rules for ordinal numbers in a list.