format-thousands
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/format-thousands package

2.0.0 • Public • Published

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

Dependencies (0)

    Dev Dependencies (8)

    Package Sidebar

    Install

    npm i format-thousands

    Weekly Downloads

    7,389

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    8.49 kB

    Total Files

    5

    Last publish

    Collaborators

    • vovanr