An open-source JavaScript library for formatting and manipulating numbers.
MIT License
Numer.js is an open-source JavaScript library for formatting and manipulating numbers.
numer.js is available on npm. It can be installed with the following command:
npm install numer.js --save
numer.js is available on yarn as well. It can be installed with the following command:
yarn add numer.js --save
If you don't want to use npm or yarn, numer.min.js can be downloaded to your project source.
new Numer(options)
The formatting style to use.
format(number)
// Node.js
const Numer = require("numer.js");
console.log(new Numer({ style: 'comma' }).format(1000000));
// expected output: "1,000,000"
console.log(new Numer({ style: 'abbreviation' }).format(9812730));
// expected output: "9.8M"
console.log(new Numer({ style: 'ordinal' }).format(1));
// expected output: "1st"
Latest version 0.1.0 (2021-09-07):
Details changes for each release are documented in the CHANGELOG.md.
If you think any of the numer.js
can be improved, please do open a PR with any updates and submit any issues. Also, I will continue to improve this, so you might want to watch/star this repository to revisit.
We'd love to have your helping hand on contributions to numer.js
by forking and sending a pull request!
Your contributions are heartily welcome, recognized and appreciated. ()
How to contribute:
The MIT License