🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

format-thousands

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

format-thousands

Format thousands with custom separator: 1 000 000

2.0.0
latest
Source
npm
Version published
Weekly downloads
8K
6.83%
Maintainers
1
Weekly downloads
 
Created
Source

format-thousands

Commitizen friendly XO code style

NPM version Build Status Coveralls Status Dependency Status DevDependency 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

Keywords

format

FAQs

Package last updated on 30 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts