french-ordinals

Ordinal numbers in French: 12 => douzième

Usage no npm install needed!

<script type="module">
  import frenchOrdinals from 'https://cdn.skypack.dev/french-ordinals';
</script>

README

french-ordinals

A very simple Node.js module that gives the ordinal representation of numbers in French: douzième for 12 etc. Based on a static list. Works up to 100.

For 1, you can add a second parameter (M or F) to distinguish between premier and première, M being default.

Installation

npm install french-ordinals

Usage

var ordinals = require('french-ordinals');

// première
console.log(`1 F => ${ordinals.getOrdinal(1, 'F')}`);

// douzième
console.log(`12 => ${ordinals.getOrdinal(12)}`);

dependencies

N/A