Tiny Number Format JavaScript Library – numer.js

Category: Javascript , Recommended | September 13, 2021
Views Total:250 views
Official Page:Go to website
Last Update:September 13, 2021


Tiny Number Format JavaScript Library – numer.js


numer.js is a super tiny (1kb minified) JavaScript library for converting, formatting and manipulating numbers.

How to use it:

1. Install the numer.js with NPM.

# Yarn
$ yarn add numer.js
$ npm i numer.js --save

2. Import the numer.js library.

<script src="numer.js"></script>

3. Format a number with commas as thousands separators.

new Numer({ 
    style: 'comma' 
=> 1,000,000

4. Abbreviate large numbers.

new Numer({ 
    style: 'abbreviation' 
=> 0.1B

5. Format a number as ordinal.

new Numer({ 
    style: 'ordinal' 
=> 2nd

You Might Be Interested In:

Leave a Reply