JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7332
  • Score
    100M100P100Q172709F
  • License MIT

Format thousands with custom separator: 1 000 000

Package Exports

  • format-thousands

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (format-thousands) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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