chemseddine201 / format-thousands

Format thousands with custom separator: 1 000 000

Home Page:https://vovanr.github.io/format-thousands

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

format-thousands

Commitizen friendly XO code style

NPM version Build Status Coveralls Status

Format thousands with custom separator: 1 000 000

Demo: vovanr.github.io/format-thousands

Install

npm install --save format-thousands

Usage

var formatThousands = require('format-thousands');

formatThousands(1000);
//=> '1 000'

formatThousands(5000, {formatFourDigits: false});
//=> '5000'

formatThousands(1000000, '`');
//=> '1`000`000'

formatThousands(10000, {separator: "'"});
//=> "10'000"

formatThousands(-100000);
//=> "-100 000"

formatThousands(10000.0001)
//=> "10 000.0001"

formatThousands();
//=> ''

License

MIT © Vladimir Rodkin

About

Format thousands with custom separator: 1 000 000

https://vovanr.github.io/format-thousands

License:MIT License


Languages

Language:JavaScript 45.4%Language:HTML 31.8%Language:CSS 22.8%